This should address issue #8. Instead of using an actual integer, % 10 to get the last number and divide by 10 to move to the next number, I keep it as a string and use .charAt(i-1) to go through the numbers. Also, rather than do i-- within the for loop, I have a boolean that keeps track of if you're odd or even.
This should address issue #8. Instead of using an actual integer, % 10 to get the last number and divide by 10 to move to the next number, I keep it as a string and use .charAt(i-1) to go through the numbers. Also, rather than do i-- within the for loop, I have a boolean that keeps track of if you're odd or even.