Created
March 26, 2016 15:42
-
-
Save mhewedy/b088eff9dbf93ddcebe2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 xs = List.fill(100)("X") | |
| var count = 0 | |
| xs.maxBy { x => | |
| { | |
| count += 1 | |
| x.length() | |
| } | |
| } //> res0: String = X | |
| println(count) //> 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment