Code:
public static String addCommas(String s){
String ret = "";
for(int i = s.length() - 1, j = 1; i > -1; i--, j++){//reverse iteration
ret = s.charAt(i) + ret;
if (j % 3 == 0){ //if evenly divisble by 3
ret = "," + ret;
}
}
return ret;
}
You can see that the above text does not align with the shaded boxes for each line. It makes it difficult to tell what line i'm on.