I am trying to decode the string encoded by the function below. I tried to reverse the encryption by doing c -= c-i, but it doesn't seem to work. Can anyone please explain how does this work?
public static String encode(String message){
StringBuilder b = new StringBuilder();
for(int i = 0;i<message.length();i++){
char c = message.charAt(i);
b.append(c += c+i);
}
return b.reverse().toString();
}