0899. Orderly Queue
Description
**Input:** s = "cba", k = 1
**Output:** "acb"
**Explanation:**
In the first move, we move the 1st character 'c' to the end, obtaining the string "bac".
In the second move, we move the 1st character 'b' to the end, obtaining the final result "acb".**Input:** s = "baaca", k = 3
**Output:** "aaabc"
**Explanation:**
In the first move, we move the 1st character 'b' to the end, obtaining the string "aacab".
In the second move, we move the 3rd character 'c' to the end, obtaining the final result "aaabc".ac
Last updated