garimasingh128 / CP-DSA-Cpp-C

🕺 Give me data and I will structure it! 🔥
85 stars 118 forks source link

Minimum Path Sum problem and solution added #72

Closed vishaljangid1729 closed 3 years ago

vishaljangid1729 commented 4 years ago

I have added a fundamental dynamic programming problem for finding a minimum path sum in a given grid.

vishaljangid1729 commented 4 years ago

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.

Note: You can only move either down or right at any point in time.

Example:

Input: [ [1,3,1], [1,5,1], [4,2,1] ] Output: 7 Explanation: Because the path 1→3→1→1→1 minimizes the sum.