466. Magic Swap Number
0
Medium
Given an integer N, you have the option to perform a Magic Swap operation by swapping two digits at most once. The goal is to obtain the maximum possible value for N after performing the swap. Print the value of N after performing the Magic Swap operation.
Input Format
A positive integer number.
Output Format
Print N after performing the Magic Swap.
Example
Input
68391
Output
98361
Constraints
1<= N <= 108
Loading...
View Submissions
Console