Last active
August 29, 2015 14:04
-
-
Save memfrag/a14f172d277de7eba671 to your computer and use it in GitHub Desktop.
[Swift] Biggest Value of a Sequence of Numbers
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
let values: [UInt] = [4, 8, 15, 16, 23, 42] | |
let biggestValue = values.reduce(0, {$1 > $0 ? $1 : $0}) | |
// biggestValue is now 42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment