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
524
Output 2:
542
Swap 2 and 5.
Swap 2 and 5 then swap 4 and 2.