fork download
  1. def change (amount: Int, coins: List[Int]) : Int = {
  2. if (coins.isEmpty or amount == 0) 0
  3. else change(amount, coins.tail) + change(amount - coins.head)
  4.  
  5. }
  6. class M extends App {
  7. println(change(15, List(5)))
  8. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.scala:1: error: expected class or object definition
def change (amount: Int,  coins: List[Int]) : Int = {
^
one error found
spoj: The program compiled successfully, but Main.class was not found.
      Class Main should contain method: def main(args: Array[String]).
stdout
Standard output is empty