We are given a set of denominations and a total amount.
- Infinite coins of each denomination are available
- All denominations are powers of 5
We have to find the minimum number of coins needed to make the total.
I wish to know the logic behind the solution. Thanks in advance.