Google Interview Question

DSA question based on Intervals, Heaps