Skip to content
playdsa
Preferences

Make yourself comfortable.

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

Theme
Advanced settings

Distance Dials

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: Distance Dials.

A wrong ordering changes who advances, while a slow repair freezes every active match.

How you win

  1. 1Recognize when Custom comparator matches the clues
  2. 2Keep this true after every move: earlier values have a smaller distance key or a smaller tie value
  3. 3Reach the result within O(n log n)

Rules and pressure

  • Target cost: O(n log n)
  • State rule: earlier values have a smaller distance key or a smaller tie value
Lesson 1 of 3

Give each value a tuple key: absolute distance from the pivot first, then the value itself as tie-break.

Your call · At pivot 4, what is the key for value 7?

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