Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.20 KB | None | 0 0
  1.   def countChange(money: Int, coins: List[Int]): Int =
  2.     if (coins.isEmpty || money < 0) 0
  3.     else if (money == 0) 1
  4.     else countChange(money, coins.tail) + countChange(money - coins.head, coins)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement