题目描述
A pair of two very large positive integers is given. Find their sum.
Example 1:
Input: s1 = "63457", s2 = "645"
Output: 64102
Explanation: 63457 + 645 = 64102
Example 2:
Input: s1 = "101", s2 = "102"
Output: 203
Explanation: 101 + 102 = 203
Your Task:
You don't need to read or print anything. Your task to complete the function add() which takes two numbers in string format as input parameter and returns their sum in string format.
Expected Time Complexity: O(max(len(s1), len(s2))
Expected Space Complexity: O(1)
Constraints:
1 <= |s1|, |s2| <= 100000
输入格式
见题面
输出格式
见题面
样例输入
s1 = "63457", s2 = "645"
样例输出
64102