feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,24 @@ categories:
patterns:
- prefix-sum
function_signature: "def is_covered(ranges: list[list[int]], left: int, right: int) -> bool:"
test_cases:
visible:
- input: { ranges: [[1, 2], [3, 4], [5, 6]], left: 2, right: 5 }
expected: true
- input: { ranges: [[1, 10], [10, 20]], left: 21, right: 21 }
expected: false
hidden:
- input: { ranges: [[1, 50]], left: 1, right: 50 }
expected: true
- input: { ranges: [[1, 2]], left: 1, right: 3 }
expected: false
- input: { ranges: [[1, 1], [3, 3]], left: 1, right: 3 }
expected: false
- input: { ranges: [[1, 5], [6, 10]], left: 1, right: 10 }
expected: true
description: |
You are given a 2D 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`.