public void addBinary(String a, String b) throws IOException{
StringBuilder sb = new StringBuilder();
int i=a.length()-1,j= b.length()-1, carry = 0;
while (i>=0 || j>=0){
int suma = carry;
if(j >=0) {
suma = suma + b.charAt(j--) - '0';
}
if(i >=0) {
suma = suma + a.charAt(i--) - '0';
}
sb.append(suma % 2);
carry= suma / 2;
}
if (carry!= 0){
sb.append(aca);
}
}
this code works perfectly. but i can understand how this logic works ( suma = suma + b.charAt(j--) - '0'; )
can someone can explain me ? thank you folks
sorry for my english