1270: Swap DigitsTime Limit: 1 Sec Memory Limit: 128 Mb Submitted: 600 Solved: 204
Now we have a number, you can swap any two adjacent digits of it, but you can not swap more than K times. Then, what is the largest probable number that we can get after your swapping?
There is an integer T (1 <= T <= 200) in the first line, means there are T test cases in total.
For each test case, there is an integer K (0 <= K < 106) in the first line, which has the same meaning as above. And the number is in the next line. It has at most 1000 digits, and will not start with 0.
There are at most 10 test cases that satisfy the number of digits is larger than 100.
For each test case, you should print the largest probable number that we can get after your swapping.
3 2 1234 4 1234 1 4321
3124 4213 4321