How do I check for adjacent characters and if they match, delete one?

Output for this string?