1# Runtime: 159 ms (Top 46.41%) | Memory: 14.4 MB (Top 92.31%)2class Solution:3def removeCoveredIntervals(self, intervals: List[List[int]]) -> int:45intervals.sort(key=lambda x: (x[0], -x[1]))6current, count = intervals[0], 17for i in range(1, len(intervals)):8if current[0] <= intervals[i][0] and intervals[i][1] <= current[1]:9continue10current = intervals[i]11count += 112return count131415# time and space complexity16# time: O(nlog(n))17# space: O(1)