Minimum Path Sum

Medium · Dynamic Programming · about 15 minutes

Asked at Amazon, Google.

Given an m × n grid of non-negative numbers, find a path from the top-left to the bottom-right cell, moving only right or down, that minimizes the sum of the numbers along it. Return that sum.

Related guides