Sweep Line Algorithm Leetcode Sql