Feature #3: Check if Meeting is Possible
Implementing the "Check if Meeting is Possible" feature for our "Google Calendar" project.
We'll cover the following...
Description
For this feature, we want to program a function that will let User A know if it is possible to schedule a meeting with User B or not. This decision will be made based on User B’s meeting schedule. If the new meeting’s time overlaps with an existing meeting in User B’s schedule, then the new meeting can not be scheduled.
Note: We will assume that User A is already free during the time of the new meeting, so no checks for this user are needed.
You will be given a list of start and end times of User B’s scheduled meetings, which are non-overlapping. Additionally, you will be given the start and end times for the proposed meeting, which we need to verify is schedulable.
Suppose that the list of timings is [[1, 3], [4, 6], [8, 10], [10, 12], [13, 15]]
, and the new meeting is [7, 8]
. In this example, you can see that the new meeting does not overlap with any existing meetings. Therefore, it can be scheduled, and the output will be true
. Now, consider if the new meeting had been [9, 11]
. It would have overlapped with [8, 10]
and [10, 12]
. Therefore, the output would have been false
.
Note: For simplicity, we are ...