# Project Euler Problem 31

Project Euler Problem 31 solution here is a clone of one I have posted at F# snippets:

let rec change sum coins = if sum = 0 then [[]] else match coins with | h::t -> let xs = change sum t if sum >= h then let ys = change (sum - h) coins |> List.map (fun xs -> h :: xs) List.append xs ys else xs | [] -> [] let problem031 () = change 200 [200;100;50;20;10;5;2;1] |> List.length

Advertisements

## Trackbacks & Pingbacks