O53
Unique Paths with Obstacles
Problem Statement & Objective
You are given an m x n integer array obstacleGrid. A path cannot pass through obstacles (marked as 1). Return the number of unique paths.
Function Signature (Python)
unique_paths_with_obstacles(grid: list[list[int]]) -> intInput & Output Contract
Output Rule:Benzersiz geçerli yol sayısı.
System Constraints
m == izgara.length, n == izgara[i].length
1 <= m, n <= 100
izgara[i][j] ∈ {0, 1}Example Execution Walkthrough
izgara = [[0, 0, 0], [0, 1, 0], [0, 0, 0]] -> ortada engel var -> 2 yolExample Test Scenarios (3)
Example 1
Input:
[[[0,0,0],[0,1,0],[0,0,0]]]Expected Output:
2Example 2
Input:
[[[0,1],[0,0]]]Expected Output:
1Example 3: Başlangıç Engelli
Input:
[[[1]]]Expected Output:
0