Tap here to switch tabs
Problem
Submissions

Problem: Check if All the Integers in a Range Are Covered

Try to solve the Check if All the Integers in a Range Are Covered problem.

Statement

You are given a 22D integer array ranges and two integers left and right. Each ranges[i] = [start_i, end_i] represents an inclusive interval between start_i and end_i.

Return true if every integer in the inclusive range [[left, right]] is covered by at least one interval in ranges. Otherwise, return false.

An integer xx is considered covered by an interval ranges[i] = [start_i, end_i] if start_i ≤x≤\leq x \leq end_i.

Constraints:

  • 1≤1 \leq ranges.length ≤50\leq 50

  • 1≤1 \leq start_i ≤\leq end_i ≤50\leq 50

  • 1≤1 \leq left ≤\leq right ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check if All the Integers in a Range Are Covered

Try to solve the Check if All the Integers in a Range Are Covered problem.

Statement

You are given a 22D integer array ranges and two integers left and right. Each ranges[i] = [start_i, end_i] represents an inclusive interval between start_i and end_i.

Return true if every integer in the inclusive range [[left, right]] is covered by at least one interval in ranges. Otherwise, return false.

An integer xx is considered covered by an interval ranges[i] = [start_i, end_i] if start_i ≤x≤\leq x \leq end_i.

Constraints:

  • 1≤1 \leq ranges.length ≤50\leq 50

  • 1≤1 \leq start_i ≤\leq end_i ≤50\leq 50

  • 1≤1 \leq left ≤\leq right ≤50\leq 50