Mercer interview question

remove consecutive duplicate character from a string.