Problem Description
Given a string A and integer B, what is maximal lexicographical string that can be made from A if you do atmost B swaps.
1 <= |A| <= 9
A contains only digits from 0 to 9.
1 <= B <= 5
First argument is string A.
Second argument is integer B.
Return a string, the naswer to the problem.
Input 1:
A = "254" B = 1
Input 2:
A = "254" B = 2
Output 1:
524
Output 2:
542
Explanation 1:
Swap 2 and 5.
Explanation 2:
Swap 2 and 5 then swap 4 and 2.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.