Easy

Quiz

#415 Add Strings

APPROACH

You are given two non-negative integers as strings num1 and num2. Add them together and return the result as a string. You may not cast either string to an integer type directly, nor use any big-integer library.

Example 1:

Input: num1 = "11", num2 = "123"
Output: "134"

Example 2:

Input: num1 = "456", num2 = "77"
Output: "533"

Example 3:

Input: num1 = "0", num2 = "0"
Output: "0"
1 of 4
1:00

What is the optimal approach for this problem?