Practice Check if All the Integers in a Range Are Covered
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a 2D integer array ranges and two integers left and right. Each ranges[i] = [starti, endi] represents an inclusive interval between starti and endi. Return true if each integer in the inclusive range [left, right] is covered by at least one interval in ranges. Return false otherwise. An integer x is covered by an interval ranges[i] = [starti, endi] if starti <= x <= endi.
Source: Check if All the Integers in a Range Are Covered on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
ranges = [[1,2],[3,4],[5,6]], left = 2, right = 5
true
# Example 2
ranges = [[1,10],[10,20]], left = 21, right = 21
false
Constraints
Related LeetCode Problems
Practice more problems similar to Check if All the Integers in a Range Are Covered.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.