Problem context and objectives
Mission briefing
Clockwork game engineer · A tournament scoreboard has jammed
Restore the order before the next round begins: The Three-Color Gate.
A wrong ordering changes who advances, while a slow repair freezes every active match.
How you win
- 1Recognize when Dutch flag partition matches the clues
- 2Keep this true after every move: everything before low is 0 and everything after high is 2
- 3Reach the result within O(n)
Rules and pressure
- Target cost: O(n)
- State rule: everything before low is 0 and everything after high is 2
New words in this mission
Open a term for a plain-language explanation.partition or shard+
One slice of a larger dataset or workload. Splitting work raises capacity, but cross-slice operations become harder.
Lesson 1 of 3
Three boundaries create four regions: finished 0s, finished 1s, unknown values, and finished 2s. Classify only current.
Your call · Current holds 0. Which boundaries advance?