← Interval & Math

Micro-Drill #259 — Check overlapping intervals

Interval & Math Target: 10s

Sort by start, then check if each interval starts before the previous one ends. Foundation for meeting rooms.

intervals.sort()
for i in range(1, len(intervals)):
    if intervals[i][0] < intervals[i-1][1]:
        return True  # overlap
return False

Type it from memory. Go.

Practice Problems

Related Coding Drills

← Micro #258 Micro #260 →