Solve View

Addition of numbers

You are given two numbers and you are to add them together and print the result. Add them up, put them into a blender and add all their values together please that would be appreciated. No negative number handling needed we don’t do negative numbers here nuh uh.

Judge

(async function*(context: Context): Challenge {
	yield* (context.runTestCases(
		[
			["3\t4", "7"],
			["10\t8", "18"],
			["1\t2", "3"],
			...range(42).map(
				i => {
					const a = rand(100);
					const b = rand(100);
					return [`${a}\t${b}`,`${a+b}`] as [string, string];
				}
			)
		]
	));
	return context.noFailures();
})

Example Code

// This was supposed to be vyxal
// but apparently for whatever reason
// the example code _has_ to be js
// and it has to pass as well.

inp = (require('fs').readFileSync(0)+'').split('\n');
inp.map(a=>a.split('\t')).map(inp=>console.log(eval(inp[0]) + eval(inp[1])))

Comments