Skip to content

Instantly share code, notes, and snippets.

@Nublo
Created October 7, 2018 15:06
Show Gist options
  • Save Nublo/0adf21a62142f34b87ebff8fc9889ca3 to your computer and use it in GitHub Desktop.
Save Nublo/0adf21a62142f34b87ebff8fc9889ca3 to your computer and use it in GitHub Desktop.
fun maxSum(xs: List<Int>) = zipWith(xs, xs.tail, {a, b -> a + b}).max()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment