Search
⌘K

Leetcode 899. Orderly Queue

Given a string s and integer k where you may repeatedly take one of the first k characters and append it to the end, return the lexicographically smallest reachable string — if k == 1 this is the problem of finding the lexicographically minimal rotation of s, while for k > 1 you can effectively fully reorder the string so the answer is s sorted.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.