def sum_str(a: str, b: str) -> str: max_str, min_str = (a, b) if len(a) > len(b) else (b, a) c = 0 tmp_num = False for i in range(len(min_str)): d = int(max_str[-(i + 1)]) + int(min_str[-(i + 1)]) d = d + 1 if tmp_num else d tmp_num = False if d > 10: tmp_num = True c += d if i == 0 else d * 10 ** i for i in range(len(min_str), len(max_str)): if tmp_num: c += int((max_str[-(i + 1)] + 1)) * 10 ** i tmp_num = False c += int(max_str[-(i + 1)]) * 10 ** i return c