KiwiTech interview question

Group strings characters - I given the logic to converting the string to array and then sort simply. asked to write the code :p