🗺️ Grid DP — Minimum Path Sum
USACO C++ Book · Interactive Visualizer
🔢 Grid Path DP — Path Count Full Demo
Grid DP
O(N×M)
Step 0/12
📊 4×4 Grid (# = obstacle, number = path count to reach cell)
🗂 DP State
Current Cell
Recurrence
Time:
O(N×M)
Space:
O(N×M)
💻 Code
Hint
Click
Next Step ▶
to start and observe how dp[r][c] = dp[r-1][c] + dp[r][c-1] fills cell by cell.
◀ Prev
Next Step ▶
↺ Reset
0/12
Keyboard:
→
Next
←
Prev
R
Reset