feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- intervals
|
||||
|
||||
function_signature: "def merge(intervals: list[list[int]]) -> list[list[int]]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { intervals: [[1, 3], [2, 6], [8, 10], [15, 18]] }
|
||||
expected: [[1, 6], [8, 10], [15, 18]]
|
||||
- input: { intervals: [[1, 4], [4, 5]] }
|
||||
expected: [[1, 5]]
|
||||
- input: { intervals: [[1, 4], [0, 4]] }
|
||||
expected: [[0, 4]]
|
||||
hidden:
|
||||
- input: { intervals: [[1, 4]] }
|
||||
expected: [[1, 4]]
|
||||
- input: { intervals: [[1, 4], [0, 0]] }
|
||||
expected: [[0, 0], [1, 4]]
|
||||
- input: { intervals: [[1, 4], [2, 3]] }
|
||||
expected: [[1, 4]]
|
||||
|
||||
description: |
|
||||
Given an array of `intervals` where `intervals[i] = [start_i, end_i]`, merge all overlapping intervals, and return *an array of the non-overlapping intervals that cover all the intervals in the input*.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user