Pergunta de entrevista da empresa Amazon

Sort string without any repeating adjacent characters.