Pergunta de entrevista da empresa Yandex

Remove subsequent repeating symbols from an input string; e.g.: "aabbbcaaccb" -> "abcacb"