Skip to content

Commit e583f35

Browse files
authored
Update MinCostToReachLastCellFromFirstCellMatrix.java
1 parent 5c9ea2a commit e583f35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

DynamicProgramming/MinCostToReachLastCellFromFirstCellMatrix.java

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
44
From the first cell reach the last cell. Each cell has a cost. Minimize total cost.
55
Allowed moves - right and bottom --> from (i,j) valid moves are --> (i+1,j) and (i,j+1)
6+
(Further) - consider diaognal moves as well
7+
68
79
Optimal substructure -
810
cost to reach(i,j) = cost[i][j] + min( cost to reach(i-1,j), cost to reach(i,j-1) )

0 commit comments

Comments
 (0)