> For the complete documentation index, see [llms.txt](https://joshualbarb.gitbook.io/leetcode-problems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://joshualbarb.gitbook.io/leetcode-problems/merge-intervals/meeting-rooms.md).

# Meeting Rooms

Merge Intervals

## Problem

Given an array of intervals representing ‘N’ appointments, find out if a person can **attend all the appointments**.<br>

{% hint style="info" %}
For example:

```
Appointments: [[6,7], [2,4], [8,12]]
Output: true
Explanation: None of the appointments overlap, 
therefore a person can attend all of them.
```

```
Appointments: [[4,5], [2,3], [3,6]]
Output: false
Explanation: Since [4,5] and [3,6] overlap, 
a person cannot attend both of these 
appointments.
```

```
Appointments: [[1,4], [2,5], [7,9]]
Output: false
Explanation: Since [1,4] and [2,5] overlap, 
a person cannot attend both of these 
appointments.
```

{% endhint %}

### Thought Process

* This is the exact same as Merge Intervals but in this problem we just return True or False if the merge or not

## Solution

```
def can_attend_all_appointments(intervals):
  intervals = sorted(intervals)
  curr = intervals[0]
  for i in range(1, len(intervals)):
    nextI = intervals[i]
    if curr[1] < nextI[0]:
      continue 
    else:
      return False
  return True


#Time: O(n)
#Space: O(1)
```
