Sweep Line Algorithm Leetcode