Question: Write a function get_max_overlap(events) that returns the two events in the events table(below) with the maximum overlap and their overlap time. Note that it does

Write a function get_max_overlap(events) that returns the two events in the events table(below) with the maximum overlap and their overlap time. Note that it does NOT have to be consecutive events. If there is more than one occurrence of the maximum overlap time, the function should return the details of the first occurrence. If none of the given events overlaps the function should return None.

events = [['A',0,3],['B',4,6],['C',8,14],['D',9,11],['E',10,16],['F',12,18]]

The helper function, get_overLap( event, event2) is provided to you (see below). You may use this function in your implementation of the get_max_overlap(events) function.

Write a function get_max_overlap(events) that returns the two events in the eventstable(below) with the maximum overlap and their overlap time. Note that it

def get overlap (event1, event2): ""\| Inputs: two overlapping events, where event1 starts before event2 Output: overlap time between the two events "\|" if event2 [2] return event2 [2] - event2 [1] else: return (event2 [2]-event1 [1])-(event2 [1]-event1 [1]) - (event2 [2]-event1 [2])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!