Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created June 19, 2014 12:24
Show Gist options
  • Save tommorris/46c3c5424df7f7a8869f to your computer and use it in GitHub Desktop.
Save tommorris/46c3c5424df7f7a8869f to your computer and use it in GitHub Desktop.
val words = List("Victoria", "Coren", "is", "barking", "up", "the", "wrong", "tree", "with", "this", "iPad", "example")
val longestWord = (x: List[String]) => x.sort(_.length > _.length).head
println(longestWord(words))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment