题目:
题解:
func addStrings(num1 string, num2 string) string {add := 0ans := ""for i, j := len(num1) - 1, len(num2) - 1; i >= 0 || j >= 0 || add != 0; i, j = i - 1, j - 1 {var x, y intif i >= 0 {x = int(num1[i] - '0')}if j >= 0 {y = int(num2[j] - '0')}result := x + y + addans = strconv.Itoa(result%10) + ansadd = result / 10}return ans
}