Deviopath › JavaScript

Unique Paths With Obstacles

Hard · Dynamic Programming

A robot starts at the top-left cell of a grid and wants to reach the bottom-right cell. It can only move right or down. Cells with 1 are obstacles, cells with 0 are free.

Write a function uniquePaths that returns the number of different paths. If the start or the end is an obstacle, return 0.

Next: Decode Ways