class Solution {
public String addStrings(String num1, String num2) {
int ll1 = num1.length() - 1;
int ll2 = num2.length() - 1;
String res = "";
int flag = 0;
while(ll1 != -1 && ll2 != -1){
int help = (num1.charAt(ll1) - '0') + (num2.charAt(ll2) - '0') + flag;
if(help >= 10){
help -= 10;
flag = 1;
}else{
flag = 0;
}
res = help + res;
ll1--;
ll2--;
}
while(ll1 != -1){
int help = (num1.charAt(ll1) - '0') + flag;
if(help >= 10){
help -= 10;
flag = 1;
}else{
flag = 0;
}
res = help + res;
ll1--;
}
while(ll2 != -1){
int help = (num2.charAt(ll2) - '0') + flag;
if(help >= 10){
help -= 10;
flag = 1;
}else{
flag = 0;
}
res = help + res;
ll2--;
}
if(flag == 1){
res = flag + res;
}
return res;
}
}