← Sorting

Pattern Recognition Drill

#114 — Meeting Rooms

Easy Intervals

The Problem

Given an array of meeting time intervals, determine if a person can attend all meetings.

What approach would you use?

Think about it before scrolling down.

Key Signals

Sorting

Sort by start. If any interval starts before the previous ends, return False. O(n log n).

Alt: Interval Merge

Merge intervals; if merged count < original count, there's overlap.

Common Trap

Don't check all pairs O(n²) — sorting first makes it a single linear scan.

← #113