class Solution:

    def removeCoveredIntervals(self, intervals: List[List[int]]) ->int:
        intervals.sort(key=lambda x: (x[0], -x[1]))
        heap = []
        remove = 0
        for start, end in intervals:
            if len(heap) > 0 and end <= -heap[0]:
                remove += 1
            heappush(heap, -end)
        return len(intervals) - remove

7598c39228f5d1d17650a77655e01f3e07dd7108
<mask token>

class Solution:
    <mask token>

class Solution:

    def removeCoveredIntervals(self, intervals: List[List[int]]) ->int:
        intervals.sort(key=lambda x: (x[0], -x[1]))
        heap = []
        remove = 0
        for start, end in intervals:
            if len(heap) > 0 and end <= -heap[0]:
                remove += 1
            heappush(heap, -end)
        return len(intervals) - remove
