II A typical dynamic programming example is the snake sequence. Given a grid of numbers, findmaximum length snake sequence and print it. A snake sequence is made up of adjacent numbers inthe grid such that for each number, the number on the right or the number below it is +1 or -1 itsvalue. For example, if you are at location (x, y) in the grid, you can either move right ie. (x+1,y) if that number is± 1 or move down i.e. (x, y+1) if that number is ± 1. The length of a snakesequence is defined as the number of moves. Given the following grid (A matrix with M rows andN colunns)
