feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 8544efb5bf
commit e0bf8cda01
134 changed files with 2075 additions and 0 deletions

View File

@@ -10,6 +10,24 @@ categories:
patterns:
- heap
function_signature: "def min_interval(intervals: list[list[int]], queries: list[int]) -> list[int]:"
test_cases:
visible:
- input: { intervals: [[1, 4], [2, 4], [3, 6], [4, 4]], queries: [2, 3, 4, 5] }
expected: [3, 3, 1, 4]
- input: { intervals: [[2, 3], [2, 5], [1, 8], [20, 25]], queries: [2, 19, 5, 22] }
expected: [2, -1, 4, 6]
hidden:
- input: { intervals: [[1, 1]], queries: [1] }
expected: [1]
- input: { intervals: [[1, 5]], queries: [0, 6] }
expected: [-1, -1]
- input: { intervals: [[1, 10], [2, 3]], queries: [2, 5] }
expected: [2, 10]
- input: { intervals: [[1, 2], [3, 4], [5, 6]], queries: [1, 3, 5, 7] }
expected: [2, 2, 2, -1]
description: |
You are given a 2D integer array `intervals`, where `intervals[i] = [left_i, right_i]` describes the i<sup>th</sup> interval starting at `left_i` and ending at `right_i` **(inclusive)**. The **size** of an interval is defined as the number of integers it contains, or more formally `right_i - left_i + 1`.