Domanda di colloquio di Morgan Stanley

Rearrange characters in a String such that no two adjacent characters are same