def solve(self , s , t ):
#1.首先把两个字符串右对齐,补0;
maxLen=max(len(s),len(t))+1
s='0'(maxLen-len(s))+s
t='0'(maxLen-len(t))+t
#2.进位标志flag初始化为1,然后从末尾逐位向前计算结果,
#并存放在结果数组rs中;
flag,rs=0,[]
for i in range(maxLen-1,-1,-1):
sum=int(s[i])+int(t[i])+flag
sub=sum%10
flag=sum//10
rs.append(str(sub))
#3.如果rs中最后一位是'0'则表示最高位没有发生进位,予以剔除;
if rs[-1]=='0':rs=rs[:-1]
#4.拼接字符串,返回结果;
rs=''.join(rs[::-1])
return rs