Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Greedy but also build up problem-solving skills.
You are given timings of n meetings in the form of (start[i], end[i]) where start[i] is the start time of meeting i and end[i] is the finish time of meeting i. Return the maximum number of meetings that can be accommodated in a single meeting room, when only one meeting can be held in the meeting room at a particular time.
Note: The start time of one chosen meeting can't be equal to the end time of the other chosen meeting.
Examples :
Input: n = 6, start[] = [1, 3, 0, 5, 8, 5], end[] = [2, 4, 6, 7, 9, 9]
Output: 4
Explanation: Maximum four meetings can be held with given start and end timings. The meetings are - (1, 2), (3, 4), (5,7) and (8,9)
Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/n-meetings-in-one-room-1587115620/1