Largest permutation after sorting one fixed-length window
You get a permutation of 1 to n and a window size w. Exactly once, choose a contiguous window of exactly w elements and sort the elements inside it. Return the lexicographically largest array you can end up with.
No answer yet. Write the first one; the best answer gets endorsed.
