Meeting Rooms
Beginner Mode

Problem Statement

Given an array of meeting time intervals where intervals[i] = [starti, endi], determine if a person could attend all meetings.

A person can attend all meetings if and only if no two meetings overlap in time. Note that meetings ending and starting at the exact same time (e.g., [1, 2] and [2, 3]) are not considered overlapping.

Additional information

  • 0 <= intervals.length <= 10^4
  • intervals[i].length == 2
  • 0 <= starti < endi <= 10^6

Example 1:

Input: intervals = [[0,30],[5,10],[15,20]]

Output: false

Explanation: The meeting [0,30] overlaps with both [5,10] and [15,20]. It is impossible to attend all of them.

Example 2:

Input: intervals = [[7,10],[2,4]]

Output: true

Explanation: The meetings [2,4] and [7,10] do not overlap. You can attend both.

Quick Solution

Code Environment

Sign in or try as guest to run your code.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →