Skip to content

Instantly share code, notes, and snippets.

@pfcoperez
Created September 29, 2016 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfcoperez/cea64d5b3dd37fa78b5b653d151cb08f to your computer and use it in GitHub Desktop.
Save pfcoperez/cea64d5b3dd37fa78b5b653d151cb08f to your computer and use it in GitHub Desktop.
val l = (1 to 3).map(x => ((x-1)*10 until x*10) toList) toList
l.foldRight(List.empty[Int]) { case (sl,acc) => sl.foldRight(acc) { case (v, l) => v :: l } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment