Meeting Rooms
Google Calendar: Meeting Conflict Detection You're implementing conflict detection for Google Calendar. Given a day's meetings as [start, end] times (in minutes from midnight), determine if one person can attend all meetings without conflicts. Example: [[0,30],[5,10],[15,20]] → False (5-10 overlaps with 0-30)
A small problem with sharp edges: do any of these time ranges overlap? It's a fast read on whether your boundary reasoning stays precise under pressure. Do meetings that touch at the same minute count as overlapping? Nail the edge cases here and you'll breeze through the harder scheduling problems.
Examples
You write
can_attend_meetings(intervals)
Example 1
- Input
- [[7,10], [2,4]]
- returns
- true
Example 2
- Input
- [[0,30], [5,10], [15,20]]
- returns
- false
The pattern behind it
Arrays & Hashing
I reach for it when
- You catch yourself scanning the array again for every element.
- The problem asks about duplicates, pairs, counts or groups.
Say this before you type. Say what the key is and what the value remembers, before you write the loop.
All 127 Arrays & Hashing problemsHeaps
I reach for it when
- You need the k largest or k smallest items.
- You repeatedly take the best remaining item.
Say this before you type. Say what the heap holds, how big it stays, and what sits on top.
All 22 Heaps problems
Meet Coco
Coco is an AI study partner, not a person. She listens while you explain your code, asks what a line does and never hands you the fix. Sign in free to type with Coco, up to a daily limit. The editor and Run stay open without an account. Anyone can open the editor and run their code.
Each locked part opens in the editor once the part before it passes.