Feature #5: Find Common Meeting Times
Implementing the "Find Common Meeting Times" feature for our "Google Calendar" project.
We'll cover the following
Description
We want to implement a feature that lets us see when two users are busy at the same time. We will be given the meeting schedule of two users, and we have to find all the overlapping meetings to determine when both of them are unavailable.
We will also assume that each user’s schedule is free of conflicting meetings, meaning their schedules are non-overlapping. Moreover, the meetings have been already sorted based on their starting time.
Let’s say that we are given the following pairs of meeting schedules: {{1, 3}, {5, 6}, {7, 9}}
and {{2, 3}, {5, 7}}
. In this example, we can see that both of the users will be busy at the following times: {{2, 3}, {5, 6}}
.
Take a look at the illustration given below:
Level up your interview prep. Join Educative to access 70+ hands-on prep courses.