fork download
  1. object Main extends App {
  2. // your code goes here
  3. def m:Map[Int,String] = Map(6->"pref 1",4 -> "pref 2")
  4. m.foldLeft(0)={case (a, (k, v)) =>
  5. if(k == 2){
  6. a + (k, "Better",v)
  7. }
  8. a
  9. }
  10. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/opt/scala/bin/scalac: line 50: /dev/null: Permission denied
Main.scala:4: error: missing arguments for method foldLeft in trait TraversableOnce;
follow this method with `_' if you want to treat it as a partially applied function
	m.foldLeft(0)={case (a, (k, v)) => 
          ^
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