Skip to content

Instantly share code, notes, and snippets.

@anderseriksson
Created April 4, 2012 15:42
Show Gist options
  • Save anderseriksson/2302967 to your computer and use it in GitHub Desktop.
Save anderseriksson/2302967 to your computer and use it in GitHub Desktop.
Top 5 foldLeft in Scala
(1 to 1000).foldLeft(List(0)) {(c,r) => (c:+r).sortWith(_>_).take(5)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment