less than 1 minute read

Given two strings a, and b, both representing an integer, add them and return it in the same string representation.

This should be implemented directly, instead of using eval or built-in big integers.

Constraints`

  • n ≤ 200 where n is the length of a
  • m ≤ 200 where m is the length of b

https://binarysearch.com/problems/String-Addition

Examples

Example 1

Input

  • a = 12
  • b = 23

Output

  • answer = 35

Explanation

12 + 23 = 35

Solution

Leave a comment