Created
June 19, 2014 12:24
-
-
Save tommorris/46c3c5424df7f7a8869f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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