Skip to content

Instantly share code, notes, and snippets.

@memfrag
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save memfrag/a14f172d277de7eba671 to your computer and use it in GitHub Desktop.
Save memfrag/a14f172d277de7eba671 to your computer and use it in GitHub Desktop.
[Swift] Biggest Value of a Sequence of Numbers
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