You are given an array A of N integers and another integer K. You can swap any two adjacent elements of A at most K times. Find the largest lexicographical array you can get. N and K in order of 10^6
You are given an array A of N integers and another integer K. You can swap any two adjacent elements of A at most K times. Find the largest lexicographical array you can get. N and K in order of 10^6