Company: Ring central_25july
Difficulty: medium
Largest Subset Problem Description A scheduling system holds n events. The i -th event begins at start[i] and ends at finish[i] ( 0 ≤ i < n ). Two events intersect if they share at least one instant of time. Events that merely touch at a start or end time are still considered to intersect. A subset of events is called high-priority if at least one event of the subset intersects every other event of that subset. (The chosen event does not have to intersect anything outside the subset, and the remaining events of the subset need not intersect one another.) Determine the maximum number of events a high-priority subset can contain. Notes: A subset containing a single event is always high-priority, so the answer is at least 1 . Several different subsets may reach the maximum size. The answer is the size , which is unique. There may be several events with the same start and end times, and an event may have start[i] == finish[i] . Function Signature Complete the function getSubsetLength