Given N groups of people who want to have a meeting in the only meeting room in the office. Each group has people[i] people, who want to start the meeting at the startingii] time and end it at the ending(i) time (both inclusive). No two groups can use the meeting room at the same time. If group j does not get the meeting room, then all the people[j] people cannot meet. Calculate the minimum number of people that cannot meet if the meeting room is optimally assigned to groups. Note: Group i and j can get the meeting room one after the other if and only if endil] < start[j]. Function description Complete the function solve. This function takes the following 4 parameters and returns the required answer: - N : Represents the number of groups - peoplef]: Represents the number of people in each group - starting[]: Represents the starting time of their meetings - endingll: Represents the ending time of their meetings Input format for custom testing Note. Use this input format if you are testing against custom input or writing code in a language where we don't provide boilerplate code. - The first line contains N denoting the number of groups. - The second line contains N space separated integers denoting the number of people in each group - people ]=[4,3,5,6,10] - startingl =[1,2,3,6,5] - ending ]=[
1

2,5
7,7

] Approach - Here the optimal way would be to first give the meeting room to the first group from 1 to 1 - Then give the meeting room to the second group from 2 to 2 . - Then give the meeting room to the third group from 3 to 5 - Then give the meeting room to the fourth group from 6 to 7 . - We can't give the meeting room to both the third and fifth groups as they overlap. - So the total number of people that got the meeting room would be 4+3+5+6= 18 - Therefore the answer would be 28−18=10 The following test cases are the actual test cases of this question that may be used to evaluate your submission Sample input 1⇔ 20 59837284859268272148060098238203 79294089366369083294018609435187 207365.44: 69758304875333447443635 Sample output 1 2504170269 - The third line contains N space-separated integers denoting the starting time of each group's meeting. - The fourth line contains N space-separated integers denoting the ending time of each group's meeting. Output format Print a single integer representing the minimum number of people who cannot have a meeting. Constraints
1≤N≤10
5

2≤ people [i]≤10
9

1≤start[i]≤10
9

1≤end[i]≤10
9

start [i]≤end[i]

Sample input 5 435610 12365 12577 Sample output 10 Explanation Given - N=5

Comments (2)