Fidelity Investments interview question

Leet code medium about string manipulation