kotlin-coding-challenges

Coins

Instructions

Given an amount of money and an array of coins write a method that computes the number of ways to make the amount of money with coins of the available coins.

Challenge Solution

Examples

Example 1

getCoins(4, listOf(1, 2, 3)) // 4

Ways to make 4 with those denominations :
1¢, 1¢, 1¢, 1¢
1¢, 1¢, 2¢
1¢, 3¢
2¢, 2¢