Challenge: Collect Coins in Minimum Steps
Coin collection in minimum steps
Suppose you are given many adjacent piles of vertically stacked coins.
You are required to calculate the minimum number of steps needed to collect these coins (minimum number of straight lines that pass through all the coins). In one step you can collect either one horizontal or one vertical line of coins, and collected coins should be continuous.
For instance, in the given illustration, the minimum number of lines is 5.