Blind 75
66 / 75Free practice

Meeting Rooms

Easy · Intervals

On LeetCode, Meeting Rooms needs LeetCode Premium (checked October 2026). Here it is free: run and submit in Python, JavaScript, Java or C++ with a free account.

Jump to code

Given meeting intervals with start < end, determine whether one person can attend every meeting. A meeting ending when another begins is allowed.

Examples

Example 1

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

Output: false

Example 2

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

Output: true

Constraints

  • 0 <= intervals.length <= 500
  • 0 <= intervals[i].start < intervals[i].end <= 1,000,000
Need a hint?

After sorting, only neighboring meetings need comparison.

Asked in real interviews

Candidates reported versions of Meeting Rooms from these company interviews. Some company questions are locked and open with Premium or XP.

Browse all real coding interview questions

Accepted submissions mark this problem complete. Progress stays in this browser.

Run checks 5 examples. Submit checks all 8 cases. A free account runs this problem; no XP needed.
Language
Case 1
Input
[
  [
    [
      0,
      30
    ],
    [
      5,
      10
    ],
    [
      15,
      20
    ]
  ]
]
Expected
false
Case 2
Input
[
  [
    [
      7,
      10
    ],
    [
      2,
      4
    ]
  ]
]
Expected
true
Case 3
Input
[
  [
    [
      1,
      2
    ]
  ]
]
Expected
true
Case 4
Input
[
  [
    [
      1,
      2
    ],
    [
      2,
      3
    ]
  ]
]
Expected
true
Case 5
Input
[
  [
    [
      1,
      4
    ],
    [
      1,
      2
    ]
  ]
]
Expected
false

Drafts are saved per language in this browser when storage is available.