Challenge: Collect Coins in Minimum Steps

In this lesson, we will find out the minimum number of steps it takes to collect coins using a given list that is the height 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.