You are viewing a single comment's thread. Return to all comments →
Scala Solution
var res = score.foldLeft((0,0),(score(0),score(0))){ case (acc, c) => c match { case c if c > acc._2._1 => ((acc._1._1+1,acc._1._2),(c,acc._2._2)) case c if c < acc._2._2 => ((acc._1._1, acc._1._2+1),(acc._2._1,c)) case _=> acc } } println(s"${res._1._1} ${res._1._2}")
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
Scala Solution