Unique paths with obstacles

easy

Right and down only, so the ways to reach a cell are the ways to reach the cell above plus the one to its left. An obstacle is just a zero - no branching logic needed.

Worst O(rows × cols)Space O(rows × cols), or O(cols) with one row
Loading the unique paths with obstacles engine…

Where to go next