O53

Unique Paths with Obstacles

Mid / Senior Engineer
Target Time: 25 - 35 Minutes
Type: NUMERIC

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]]) -> int

Input & 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 yol

Example Test Scenarios (3)

Example 1
Input:[[[0,0,0],[0,1,0],[0,0,0]]]
Expected Output:2
Example 2
Input:[[[0,1],[0,0]]]
Expected Output:1
Example 3: Başlangıç Engelli
Input:[[[1]]]
Expected Output:0
Loading Python Editor...
Input Parameters
[
  [
    [
      0,
      0,
      0
    ],
    [
      0,
      1,
      0
    ],
    [
      0,
      0,
      0
    ]
  ]
]
Expected Output
2