---
# System prepended metadata

title: Minimum Number of Coins pick Greedy Solution

---

# Minimum Number of Coins pick Greedy Solution

```
def findMinNumberOfCoins(amount):
    coinsArr = [1, 2, 5]
    coinsArr.sort()
    result = []
    i = len(coinsArr) - 1
    while (i >= 0):
        while (amount >= coinsArr[i]):
            amount -= coinsArr[i]
            result.append(coinsArr[i])
        i -= 1
    for i in range(len(result)):
        print(result[i], end=" ")


number = 18
print("Following is minimal number",
      "of change for", number, ": ", end="")
findMinNumberOfCoins(number)

```