bj0
fun function(text: String) = text.split("(?<=(.))(?=.)(?!\\1)".toRegex()) .flatMap { it.chunked(2).map { it.take(1) } } .joinToString("")