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

349AQ431, 12qe312qe3