Skip to content
playdsa
Preferences

Make yourself comfortable.

Saved on this browser. Your device’s reduced-motion preference is always respected.

Theme
Advanced settings

Boss fightRelative Ranks

Learn
Play
Prove
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

  1. 1Recognize when Frequency-guided ordering matches the clues
  2. 2Keep this true after every move: all emitted priority groups follow the requested order
  3. 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?

Help shape PlayDSA

Something confusing, broken, or missing? Leave a quick note without leaving your lesson.

Please leave out passwords, payment details and other private information.

Page included: /

Sign in to save feedback here, or send it with your email app. Your draft stays here while you sign in.

Open email instead