ABC interview question

Normalization , Java , revering the string