A concert is organized in an auditorium with capacity C. They have opened a booking system where fans can buy tickets by giving their group size, entry time and exit time. The organizers want to accommodate all the groups in order to maximize profit. All this information is stored in a 2D array audience, where audience[i]=[strength,entrytime,exittime].
Task
Check if all the groups can be accommodated in the auditorium.
Notes
Example 1
Assumptions
Input
Output: Yes
Approach
Function description
Complete the function solution() provided in the editor. The function takes 3 parameters and returns the solution:
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
Output format
Print a string representing if it is possible to accommodate all groups.
Constraints
1≤N≤1051≤C≤1091≤strength≤1091≤entrytime≤exittime≤109
Sample
Given
Input
Output: No
Approach
At time 1, 2 people enter. At time 3, 3 more people enter. The total number of people is 5. This exceeds the capacity, hence the answer is No.