number. You may swap two of its digits at most once.
Return the largest number you can get this way.number=4182 → 8142
Swap the 4 and the 8 to get 8142.
number=8651 → 8651
The digits are already in descending order, so any swap would only make it smaller.
number=1993 → 9913
number=4182
8142
Run checks the first 3 tests in your browser. Submit checks all 122 tests on the server, hidden ones included.