FunctionRacerProblemsRace

Add Strings

EasyMathPython, JavaScript, TypeScript, Java, C++

num1 and num2 are non-negative whole numbers written as digit strings. Return their sum as a string. Add digit by digit with a carry, like on paper, without converting the whole strings to integers.

Example 1

num1 "11"
num2 "123"
returns "134"

11 + 123 = 134.

Example 2

num1 "999"
num2 "1"
returns "1000"

The carry makes a new digit: 1000.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems