Google interview question

Question based on Maps Course Schedule II - Leetcode Segment Tree