InterviewBit Academy is now Scaler!
InterviewBit Academy is now Scaler Academy!

Min Sum Path in Matrix

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 2
       4 3 1
       5 6 1

Output : 8
     1 -> 3 -> 2 -> 1 -> 1
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Min Sum Path in Matrix on Interview Code Editor
Sign Up
to access hints and editorial solutions for Min Sum Path in Matrix
Asked In:


Click here to start solving coding interview questions