Skip to content

Instantly share code, notes, and snippets.

@windmaomao
Created September 26, 2020 14:08
Show Gist options
  • Save windmaomao/7a4aa04ce069a559b94eac8f66269b6b to your computer and use it in GitHub Desktop.
Save windmaomao/7a4aa04ce069a559b94eac8f66269b6b to your computer and use it in GitHub Desktop.
// aoc2015-day3-evenOddGroups.kt
fun evenOddGroups(s: String) = s
.withIndex()
.groupBy { it.index % 2 }.values
.map { it.map { v -> v.value }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment