Sweep Line Algorithm Leetcode Problem