2011-08-14から1日間の記事一覧

ある金額になるコインの組み合わせ

ref:http://d.hatena.ne.jp/fumokmm/20110813/1313196903 こんなんかな。 coinCombinations :: Int -> [Int] -> [[Int]] coinCombinations total coins | total == 0 = [[]] | null coins = [] | total < first = firstUnusedList | otherwise = firstUsedLi…