I knew it, I was missing something I thought that having 2 characters was enough. But, let us leave the discussion here instead of discussing more solutions since it would be unfair to the original site.
Yes, it is not easy.
It's easy to get lost coming up with efficient solutions. I started with a solution that eliminated characters that are followed by duplicates, but then you're left with a string that might contain more than two distinct characters, and eliminating one (preferably the one with the least occurrences) might lead to other duplicate characters getting jammed together.