Skip to content
playdsa
Preferences

Make yourself comfortable.

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

Theme
Advanced settings

The Single Hall

Learn
Play
Prove
Problem context and objectives
Mission briefing

Puzzle systems engineer · A game mechanic is behaving incorrectly

Reject any overlapping meeting: The Single Hall.

Brute force may pass the demo but fail when the world fills with players.

How you win

  1. 1Recognize when Meeting conflict detection matches the clues
  2. 2Keep this true after every move: all meetings before the scan index are mutually compatible
  3. 3Reach the result within O(n log n)

Rules and pressure

  • Target cost: O(n log n)
  • State rule: all meetings before the scan index are mutually compatible
Lesson 1 of 3

Live algorithm trace

Meeting conflict detection

Complete execution
1 of 4

Sort all meetings by their start time.

1sort meetings by start
2for each adjacent pair
3if current start < previous end: return false
4return true
order = already sorted
Truth to preserve / Cost target
Truth to preserve

all meetings before the scan index are mutually compatible

Cost target

O(n log n)

After sorting meetings by start, an overlap can only occur with the immediately previous meeting. If every start is at least the previous end, one room is enough.

Your call · What should guide every step of this algorithm?

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