bamdmux
fun <T> Collection<T>.splitPairs(): List<Pair<T, T>> = withIndex() .partition { it.index % 2 == 0 } .let { it.first.zip(it.second) { a, b -> a.value to b.value } }