rook
listOf("a", "b", "b", "a", "b").distinctFromAdjacent() // result a,b,a,b
Ruckus
listOf("a", "b", "b", "a", "b") .windowed(2, partialWindows = true) .filter { it.size == 1 || it[0] != it[1] } .map { it[0] }
windowed
A modern programming language that makes developers happier.