Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
For each pile i, what will be the total value of coins we can collect if we choose the first j coins?
How can we use dynamic programming to combine the results from different piles to find the most optimal answer?