initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
module _31
|
||||
|
||||
let getCurrencyCombos =
|
||||
let total, coins = 200, [1;2;5;10;20;50;100;200]
|
||||
|
||||
let rec count (n, coins) =
|
||||
match n, coins with
|
||||
| 0,_ -> 1
|
||||
| n,_ when n < 0 -> 0
|
||||
| n,[] when n >= 1 -> 0
|
||||
| n,coins -> count (n, coins |> List.tail) + count (n - (coins |> List.head),coins)
|
||||
|
||||
count (total, coins)
|
||||
Reference in New Issue
Block a user