Dashboard
LC #253

Meeting Rooms II

Pattern · ?AmazonGoogleMetaBloombergMicrosoft

Problem

Find the minimum number of conference rooms required to hold all meetings.

Constraints

  • 1 ≤ n ≤ 10⁴
  • 0 ≤ startᵢ < endᵢ ≤ 10⁶

Example

Input
intervals = [[0,30],[5,10],[15,20]]
Output
2
Why
Room 1: [0,30]. Room 2: [5,10] then [15,20]. Need 2 rooms minimum

Spot the pattern

Which pattern cracks it?

Hints

One at a time
Solve on LeetCode ↗