Intervals practice problems
Starts and ends: do they clash, where is the gap, how many at once. A concept: the material itself — what it is, and what it costs you to use. 16 problems in the bank train it, each with a worked example, a hint and a reference solution.
- Math
- Strings
- Arrays
- Hash maps
- Sorting
- Parsing
- Two pointers
- Sliding window
- Prefix sums
- Stacks
- Binary search
- Intervals
- Grids
- Greedy
- Recursion
- Simulation
- Bit manipulation
16 problems
- Do these two bookings clasheasy
- Do these two shifts overlapeasy
- Total minutes scheduledeasy
- Rest-period violations in the hand-offseasy
- Do two bookings clasheasy
- Find the first free slot in a dayhard
- Merge overlapping bookingshard
- Extra pay for overnight hourshard
- How many event pairs overlaphard
- Is there enough breathing room between slotshard
- How many rooms are needed at peakhard
- How many people try to book the same slotmedium
- Largest uncovered stretch of the daymedium
- Most people on the floor at oncemedium
- Total minutes the line was downmedium
- Total hours a machine ranmedium