This is a classic Dynamic Programming question where there is a (row x column) board which has coin placed on some of the squares. A robot travels from the upper left corner to the bottom right corner collecting coins. The robot can only move from left to right or from top to down at a time. You have to find the maximum number of coins picked up by the robot and also print that particular path on which robot collects that max number of coins.
for more info check this: https://www.youtube.com/watch?v=94FEC_uNwVM
and for reading more: https://sites.utexas.edu/zhouyuqi/algorithms/