feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent d2b74b6863
commit 85fea3a4bb
94 changed files with 1840 additions and 0 deletions

View File

@@ -10,6 +10,30 @@ patterns:
- dynamic-programming
- matrix-traversal
function_signature: "def unique_paths_with_obstacles(obstacle_grid: list[list[int]]) -> int:"
test_cases:
visible:
- input: { obstacle_grid: [[0, 0, 0], [0, 1, 0], [0, 0, 0]] }
expected: 2
- input: { obstacle_grid: [[0, 1], [0, 0]] }
expected: 1
- input: { obstacle_grid: [[0, 0], [0, 0]] }
expected: 2
hidden:
- input: { obstacle_grid: [[1]] }
expected: 0
- input: { obstacle_grid: [[0]] }
expected: 1
- input: { obstacle_grid: [[1, 0]] }
expected: 0
- input: { obstacle_grid: [[0, 0, 0, 0], [0, 0, 0, 0]] }
expected: 4
- input: { obstacle_grid: [[0, 1, 0, 0, 0], [1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] }
expected: 0
- input: { obstacle_grid: [[0, 0, 0], [0, 0, 0], [0, 0, 1]] }
expected: 0
description: |
You are given an `m x n` integer array `grid`. There is a robot initially located at the **top-left corner** (i.e., `grid[0][0]`). The robot tries to move to the **bottom-right corner** (i.e., `grid[m - 1][n - 1]`). The robot can only move either down or right at any point in time.