LeetCode

Orderly Queue

Click here for an explanation.