Advertisement
Guest User

Untitled

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