Merge Intervals Leetcode Solution In Python