Unique Grid Paths with Obstacles

medium
Unit 12 · Dynamic Programming II0/3 to milestone

A robot starts at the top-left of a grid and can only move right or down to reach the bottom-right. Cells with 1 are obstacles. Return the number of distinct paths, using a single row of DP (O(columns) space).

Also implement min_path_sum(grid): the minimum sum of numbers along a right/down path through a grid of non-negative numbers.

#dynamic-programming#grids2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Unique Grid Paths with Obstacles · TechGradify