J.P. Morgan interview question

string manipulation, leet code easy