利用BigInteger
import java.util.*;
import java.math.BigInteger;
public class Solution {
public String solve (String s, String t) {
// write code here
int a = s.length();
int b = t.length();
if(a == 0 || b==0){
if(a==0){
return t;
} else{
return s;
}
}
BigInteger ss =new BigInteger(s);
BigInteger tt =new BigInteger(t);
BigInteger res = ss.add(tt);
String ans = res.toString();
return ans;
}
}