Amazon | SDE2 VO | calculate the minimum path of a matrix from left most column to right most column
Anonymous User
436

Given a rectangular matrix, return the sum of the minimum path from leftmost column to the rightmost column.
Only 3 directions can move, right, up, down.

e.g.

[ [51 , 24 , 19*, 10* ],
[18*, 12*, 23*, 40 ],
[60 , 19 , 67 , 42 ]]

return 82
82=18+ 12+ 23+ 19+ 10

I just came up the backtrack solution,

I think there have DP way to solve, right?

Comments (2)