Problem context and objectives
Mission briefing
Clockwork game engineer · A tournament scoreboard has jammed
Restore the order before the next round begins: Relative Ranks.
A wrong ordering changes who advances, while a slow repair freezes every active match.
How you win
- 1Recognize when Frequency-guided ordering matches the clues
- 2Keep this true after every move: all emitted priority groups follow the requested order
- 3Reach the result within O(n log n)
Rules and pressure
- Target cost: O(n log n)
- State rule: all emitted priority groups follow the requested order
Lesson 1 of 3
Build a frequency map first. The priority list chooses group order, while each count tells how many copies the stamp releases.
Your call · Priority is [2,3]. Which tower is stamped first?