feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent 98ebb1600f
commit 16b02451d0
94 changed files with 1840 additions and 0 deletions

View File

@@ -10,6 +10,20 @@ patterns:
- dfs
- matrix-traversal
function_signature: "def pacific_atlantic(heights: list[list[int]]) -> list[list[int]]:"
test_cases:
visible:
- input: { heights: [[1, 2, 2, 3, 5], [3, 2, 3, 4, 4], [2, 4, 5, 3, 1], [6, 7, 1, 4, 5], [5, 1, 1, 2, 4]] }
expected: [[0, 4], [1, 3], [1, 4], [2, 2], [3, 0], [3, 1], [4, 0]]
- input: { heights: [[1]] }
expected: [[0, 0]]
hidden:
- input: { heights: [[1, 1], [1, 1]] }
expected: [[0, 0], [0, 1], [1, 0], [1, 1]]
- input: { heights: [[1, 2], [4, 3]] }
expected: [[0, 1], [1, 0], [1, 1]]
description: |
There is an `m x n` rectangular island that borders both the **Pacific Ocean** and **Atlantic Ocean**. The **Pacific Ocean** touches the island's left and top edges, and the **Atlantic Ocean** touches the island's right and bottom edges.