Dias
04/10/2019, 4:02 PMlistOf("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 oneghedeon
04/10/2019, 4:30 PMDias
04/10/2019, 5:01 PMDias
04/10/2019, 5:02 PM"a", "b", "c", "c", "c", "c"
to "a", "b", "c"
, but maybe he wanted it to be "a", "b", "c", "c"
Dias
04/10/2019, 5:02 PM