Medium · Dynamic Programming
Minimum Path Sum
Given an m × n grid of non-negative integers, return the minimum sum of the values along a path from the top-left cell to the bottom-right cell that moves only right or down.
Examples
Example 1
[[1,3,1],[1,5,1],[4,2,1]]Output: min sum 7
Example 2
[[1,2,3],[4,5,6]]Output: min sum 12
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.