2025-08-16 08:13:51 +0000 UTC

Check if All the Integers in a Range Are Covered

Code

class Solution:
    def isCovered(self, ranges: List[List[int]], left: int, right: int) -> bool:
        cov = [False] * (right - left + 1)
        for start, end in ranges:
            for num in range(max(left, start), min(end, right) + 1):
                cov[num - left] = True
        return False not in cov