You have to organize meetings today. There are N meetings for today. Meeting i must start at time start[i] and end at time end[i]. Unfortunately, there are only two meeting rooms available today. Consider meetings a and b intersecting in time if max(start[a], start[b])≥min(end[a], end[b]).
You cannot conduct two meetings in the same room at the same time.
Your task is to determine whether it is possible to hold all meetings using only two rooms. If yes, then print 1. Otherwise, print 0.
Function description
Complete the isPossible function in the editor. It contains the following parameters:
Input format
Constraints
1≤n≤1051≤start[i]≤1081≤end[i]≤108
Hold the first ([1; 2]) and the third ([4; 5]) meetings in the first room.
Hold the second meeting ([2; 3]) in the second room.