Meeting Rooms 2 - Minimum Meeting Rooms Required

Problem Given a list of intervals representing the start and end time of ‘N’ meetings, find the minimum number of rooms required to hold all the meetings. Examples Example 1: Meetings: [ [1,4], [2,5], [7,9] ] Output: 2 Explanation: Since [1,4] and [2,5] overlap, we need two rooms to hold these two meetings. [7,9] can occur in any of the two rooms later. ...

Meeting Rooms 1 - Can person attend all meetings

Problem Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determine if a person could attend all meetings. Examples Example 1: Input: intervals = [(0,30),(5,10),(15,20)] Output: false Explanation: (0,30), (5,10) and (0,30),(15,20) will conflict ...

Merge Overlapping Intervals

Problem Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. OR Given a list of intervals, merge all the overlapping intervals to produce a list that has only mutually exclusive intervals. Examples Example 1: Input: intervals = [1,3],[2,6],[8,10],[15,18], Output: [1,6],[8,10],[15,18]. ...

Check if Intervals Overlap

Problem Given a set of intervals, find out if any two intervals overlap. Example: Intervals: [ [1,4], [2,5], [7,9] ] Output: true Explanation: Intervals [1,4] and [2,5] overlap Solution Method 1 - Sorting Let’s take the example of two intervals (‘a’ and ‘b’) such that a.start <= b.start. There are three possible scenarios: ...

Maximum Intervals Overlap Count

Problem Find maximum intervals overlap. OR There is number of elephants time span given, here time span means, year of birth to year of death. You have to calculate the period where maximum number of elephants are alive. OR Consider a big party where a log register for guest’s entry and exit times is maintained. Find the time at which there are maximum guests in the party. Note that entries in register are not in any order. ...

This site uses cookies to improve your experience on our website. By using and continuing to navigate this website, you accept this. Privacy Policy