Problems Involving Grids - 1
Learn to solve easy grid-based problems with dynamic programming.
We'll cover the following...
Problem statement
We are going to start from the simplest problems based on Grids and move on to more complex grid problems in subsequent lessons. The problem in this lesson tries to solve the following type of question:
Finding Minimum-Cost Path in a 2-D Matrix
The problem statement is:
Given a cost matrix cost[][]
, where cost[i][j]
denotes the cost of visiting cell with coordinates
(i,j)
, find a min-cost path to reach a cell (x,y)
from cell (0,0)
under the condition that you can only
travel one step right or one step down. (Assume that ...