You are given an initial list of events, where each event has a unique
eventIdand apriority.Implement the
EventManagerclass:
EventManager(int[][] events)Initializes the manager with the given events, whereevents[i] = [eventId_i, priority_i].void updatePriority(int eventId, int newPriority)Updates the priority of the active event with ideventIdtonewPriority.int pollHighest()Removes and returns theeventIdof the active event with the highest priority. If multiple active events have the same priority, return the smallesteventIdamong them. If there are no active events, return -1.An event is called active if it has not been removed by
pollHighest().
1 | class EventManager { |