Description

Given two non-negative integers as strings, return their sum as a string. Don't convert to integers.

Examples

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

11 + 123 = 134

Input:num1 = "a", num2 = "a"
Output:"134"
Explanation:

Single-character string inputs representing minimal digit addition.

Input:num1 = "456", num2 = "789"
Output:1245
Explanation:

456 + 789 = 1245. This example demonstrates addition with carry operations in multiple positions, helping students understand how to handle cascading carries when implementing string addition digit by digit.

Constraints

  • 1 ≤ num1.length, num2.length ≤ 10⁴

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!