Maximum swap
Given a non-negative integer, swap two of its digits at most once to make the largest number possible. Record the last position of each digit, then find the first digit that has a larger digit later on.
No answer yet. Write the first one; the best answer gets endorsed.
