For an n-digit number, you only have n possibilities of which digit being removed could produce a maximum difference. Have you tried just brute-forcing it?
Show what you tried in the 1,2,3-digit cases.
- Put another way, what you really need to do is make a function like "int remove_digit(int number, int digit_index)" that removes the digit from the number at the given digit_index.
Then, you loop over this function from the first digit to the last digit, and see which one produces a maximum difference.
- You can do this the hard way, using base-10 manipulate with a combination of for loops and % 10 and / 10, or take the easy way out and convert the digit to a string and back.