import java.util.*;
public class Solution {
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
* 计算两个数之和
* @param s string字符串 表示第一个整数
* @param t string字符串 表示第二个整数
* @return string字符串
*/
public String solve (String s, String t) {
if((s == null || "".equals(s)) && (t == null || "".equals(t))) {
return "";
}
if(s == null || "".equals(s)) {
return t;
}
if(t == null || "".equals(t)) {
return s;
}
int jw = 0;
char[] ss = s.toCharArray();
char[] ts = t.toCharArray();
StringBuilder res = new StringBuilder();
for(int i = ss.length - 1, j = ts.length - 1; i >= 0 || j >= 0;) {
int sn = 0;
int tn = 0;
if(i < 0) {
sn = 0;
} else {
sn = Integer.parseInt(ss[i] + "");
}
if(j < 0) {
tn = 0;
} else {
tn = Integer.parseInt(ts[j] + "");
}
int cal = jw + sn + tn;
if(cal > 9) {
res.insert(0, cal - 10 + "");
jw = 1;
} else {
res.insert(0, cal + "");
jw = 0;
}
i--;
j--;
}
if(jw == 1) {
res.insert(0, "1");
}
return res.toString();
}
}