1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits
Last updated
Last updated
**Input:** num = "4321", k = 4
**Output:** "1342"
**Explanation:** The steps to obtain the minimum integer from 4321 with 4 adjacent swaps are shown.**Input:** num = "100", k = 1
**Output:** "010"
**Explanation:** It's ok for the output to have leading zeros, but the input is guaranteed not to have any leading zeros.**Input:** num = "36789", k = 1000
**Output:** "36789"
**Explanation:** We can keep the number without any swaps.**Input:** num = "22", k = 22
**Output:** "22"**Input:** num = "9438957234785635408", k = 23
**Output:** "0345989723478563548"