Domanda di colloquio di Grant Street Group

leet-code easy question, something about manipulate the substring