You are given a 2D map consisting of an R x C grid of squares; in each square, there is a number representing the elevation of the terrain at that square. Find a path going from square (1, R), which is the top left corner of the map, to the square immediately below or to the square immediately to the right so that the number of moves from lower elevation to higher elevation along such a path is as small as possible. (20 pts)
Hint: This is a straightforward Dynamic Programming, filling a table of the size of the map.