Challenge: Collect Coins in Minimum Steps

Find the minimum number of steps needed to collect coins using the heights of vertically stacked coins.

Coin collection in minimum steps

Suppose you are given many adjacent piles of vertically stacked coins, like so:

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.