Largest permutation after sorting one fixed-length window

0
Remix

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.

AmazonOnline assessmentLast asked Oct 2026
No answer yet. Write the first one; the best answer gets endorsed.