The Trade Desk Interview Question

straight from leetcode hard section: skyline problem