Gold Mine Problem Assignment
Question 1 Given a gold mine calledMof (n xm)dimensions. Each field in this mine contains a positive integer which is the amount of gold in tons. Initially the miner can start from any row in the first column. Froma given cell, the miner can move
- to the cell diagonally up towards the right
- to the right
- to the celldiagonally down towards the right
Find out maximum amount of gold which he can collect.
A)Input: n = 3, m = 3 M = {{1, 3, 3}, {2, 1, 4}, {0, 6, 4}}; B)Input: n = 4, m = 4 M = {{1, 3, 1, 5}, {2, 2, 4, 1}, {5, 0, 2, 3}, {0, 6, 1, 2}};