Tap here to switch tabs
Problem
Submissions

Problem: Unique Paths II

med
30 min
Try to solve the Unique Paths II problem.

Statement

Given a rectangular grid obstacleGrid with m rows and n columns, a robot starts at the top left cell and wants to reach the bottom right cell. The robot may move only one cell at a time either right or down.

Each cell in obstacleGrid is either empty or blocked by an obstacle. An obstacle is represented by 1, and an empty cell is represented by 0. Return the number of distinct paths from the start to the destination that avoid all obstacles.

Constraints:

  • m == obstacleGrid.length

  • n == obstacleGrid[i].length

  • 11 \leq m, n 100\leq 100

  • obstacleGrid[i][j] is 0 or 1

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths
Tap here to switch tabs
Problem
Submissions

Problem: Unique Paths II

med
30 min
Try to solve the Unique Paths II problem.

Statement

Given a rectangular grid obstacleGrid with m rows and n columns, a robot starts at the top left cell and wants to reach the bottom right cell. The robot may move only one cell at a time either right or down.

Each cell in obstacleGrid is either empty or blocked by an obstacle. An obstacle is represented by 1, and an empty cell is represented by 0. Return the number of distinct paths from the start to the destination that avoid all obstacles.

Constraints:

  • m == obstacleGrid.length

  • n == obstacleGrid[i].length

  • 11 \leq m, n 100\leq 100

  • obstacleGrid[i][j] is 0 or 1

Unlock AI-Powered LearningUpgrade to smarter learning with instant explanations of Ask Agent, Personalized Interview Prep, Real-World Projects, 3 AI Mock Interviews per month, and Personalized Paths