Recall & Review
beginner
What is the problem statement of Unique Paths in Grid DP?
Find the number of ways to move from the top-left corner to the bottom-right corner of a grid, moving only right or down.
Click to reveal answer
beginner
What does the DP state represent in Unique Paths problem?
DP[i][j] represents the number of unique paths to reach cell (i, j) from the start.
Click to reveal answer
intermediate
What is the recurrence relation used in Unique Paths DP?
DP[i][j] = DP[i-1][j] + DP[i][j-1], summing paths from the top and left cells.
Click to reveal answer
beginner
Why do we initialize the first row and first column with 1 in Unique Paths DP?
Because there is only one way to reach any cell in the first row (all moves right) or first column (all moves down).
Click to reveal answer
intermediate
How does Unique Paths DP handle obstacles in the grid?
Cells with obstacles have 0 paths; DP skips adding paths through those cells.
Click to reveal answer
In Unique Paths DP, what does DP[i][j] represent?
✗ Incorrect
DP[i][j] stores the count of unique ways to reach cell (i, j).
What is the base case for the first row in Unique Paths DP?
✗ Incorrect
First row cells have 1 path each, moving only right.
Which moves are allowed in Unique Paths problem?
✗ Incorrect
Only moves down or right are allowed.
How do obstacles affect the DP table in Unique Paths with obstacles?
✗ Incorrect
Obstacles block paths, so DP value is zero for those cells.
What is the time complexity of Unique Paths DP solution?
✗ Incorrect
We fill an m by n DP table once, so O(m*n).
Explain how to build the DP table for Unique Paths problem step-by-step.
Think about how you move only right or down and how paths add up.
You got /4 concepts.
Describe how obstacles change the Unique Paths DP approach.
Obstacles block movement, so no paths go through them.
You got /4 concepts.