Given a string A and integer B, what is maximal lexicographical stringthat 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.
A = "254" B = 1
A = "254' B = 2
Swap 2 and 5.
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 doubt? Checkout Sample Codes for more details.