Company: Intuit_26nov
Difficulty: medium
Largest Subset Problem Description A scheduling system tracks n events using two arrays, start and finish , each of size n . Event i (for 0 ≤ i start[i] to finish[i] . Call a subset of these events high-priority if some single event in the subset overlaps every other event contained in it. Find the size of the largest possible high-priority subset. Notes Events that overlap at their start or end times are considered to intersect. There may be multiple events with the same start and end times. Examples Example 1 Input: n = 4, start = [1, 2, 3, 4], finish = [2, 3, 5, 5] Output: 3 Explanation: Taking {[2, 3], [3, 5], [4, 5]} works because [3, 5] overlaps both of the other two events in the group, and no larger such group exists, so the answer is 3. Example 2 Input: n = 5, start = [1, 3, 4, 6, 9], finish = [2, 8, 5, 7, 10] Output: 3 Explanation: Taking {[3, 8], [4, 5], [6, 7]} works because [3, 8] overlaps both of the other two events in the group. Example 3 Input: n = 5, start = [1, 2,