About the Pattern: Merge Intervals - Problem Challenge 3 category


Have questions about Problem Challenge 3? Go for it!

View the lesson here.


I am not sure how the heap was implemented in the solution. Why do you place the comparison function in the Employee Interval class, shouldn’t the minheap already know that it keeps track of the smallest item. Furthermore, I was confused why the first element of the heap was saved and compared to the popped element from the minheap in the loop. Aren’t those two elements the same thing(at least at first)?


The second and third test cases are missing the ‘intervals = find_employee_free_time(input)’