Largest Number Possible After At Most K Swaps

easy
1. You are given a string which represents digits of a number.
2. You have to create the maximum number by performing at-most k swap operations on its digits.

Note -> Check out the question video and write the recursive code as it is intended without 
               changing signature. The judge can't force you but intends you to teach a concept.

Input Format

A string S and a number K

Output Format

A number

Constraints

1 <= length of S <= 30
1 <= K <= 10

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
1234567
4
Output
7654321
Previous
Remove Invalid Parenthesis
Next
Gold Mine - 2

Related Questions