Non Overlapping Intervals Leetcode Sql Server