def solution(characters): result = characters[0] for ch in characters[1:]: if ch != result[-1]: result += ch return result print(solution("senteeeencccccceeee"))
To embed this project on your website, copy the following code and paste it into your website's HTML: