Complete the code to declare the variable that stores the number of meeting rooms needed.
int [1] = 0;
The variable maxRooms is used to keep track of the minimum number of rooms required.
Complete the code to sort the start times of meetings.
qsort(start, n, sizeof(int), [1]);The function compareInts is used to sort integer arrays like start times.
Fix the error in the loop that checks overlapping meetings.
for (int i = 1; i < n; i++) { if (start[i] < [1]) { rooms++; } else { endIndex++; } }
We compare the current start time with the earliest end time end[endIndex] to check overlap.
Fill both blanks to correctly update the number of rooms and the end index.
if (start[i] < end[[1]]) { [2]++; } else { endIndex++; }
Compare start[i] with end[endIndex]. If overlapping, increase rooms count.
Fill all three blanks to create a dictionary of meeting start times and their counts for overlap.
for (int i = 0; i < n; i++) { countMap[[1]] = countMap[[2]] + [3]; }
We use start[i] as key to countMap and add 1 to increment count.
