Grid DP
grid-dp
Practice Problems
Minimum Path Sum
Given an m x n grid filled with non-negative numbers, find a path from the top-left to the bottom-right that minimizes the sum of all numbers along the path.
Triangle
Given a triangle array, return the minimum path sum from top to bottom, where at each step you may move to an adjacent number on the row below.
Unique Paths II
Given an m x n grid with obstacles, count the number of unique paths from the top-left corner to the bottom-right corner, moving only right or down.
Unique Paths
Given an m x n grid, find the number of unique paths from the top-left corner to the bottom-right corner, moving only right or down.
Question Banks
Community
Dungeon Game
Find the minimum starting health a knight needs to traverse a dungeon grid from top-left to bottom-right, using REVERSE bottom-up DP from the princess cell.
Cherry Pickup
Maximize cherries collected by walking from top-left to bottom-right and back, modeled as two simultaneous forward walks with shared cells counted once.
Minimum Falling Path Sum
Find the minimum sum of a top-to-bottom path in a square matrix where each step moves to one of three cells directly below, using row-by-row DP.
