something like ```listOf("a", "b", "c", "c").fold(...
# announcements
d
something like
Copy code
listOf("a", "b", "c", "c").fold(mutableListOf<String>()) { acc , s ->
        if (s != acc.lastOrNull()) {
            acc.add(s)
        }
        acc
    }
maybe? Ah no it's not going to work, it will just remove all consecutive characters except the first one
g
why not? Is the definition of adjacent distinction different from this?
d
well it depends on what Ben wanted
my code would reduce
"a", "b", "c", "c", "c", "c"
to
"a", "b", "c"
, but maybe he wanted it to be
"a", "b", "c", "c"
basically reduce by pairs of adjacents