Given a number K and string str of digits denoting a positive integer, build the largest number possible by performing swap operations on the digits of str at most K times.
- Time : O(n^2 * k!)
- Space : O(1)
1 | class Solution { |
Given a number K and string str of digits denoting a positive integer, build the largest number possible by performing swap operations on the digits of str at most K times.
1 | class Solution { |