Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def countChange(money: Int, coins: List[Int]): Int = {
  2. if (money < 0 || coins.isEmpty) 0
  3. else if (money == 0) 1
  4. else countChange(money - coins.head, coins) + countChange(money, coins.tail)
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement