Skip to main content

Minimum Path Sum

Learn Minimum Path Sum (Dynamic Programming, Advanced DSA) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Minimizing the Sum Along a Path Same grid-DP framework as Unique Paths, with the combine operation changed from SUM to MIN: dp[r][c] = grid[r][c] + min(dp[r-1][c], dp[r][c-1]) - each cell picks whichever of "from above" or "from left" gives the cheaper running total.

More lessons in Dynamic Programming