Blenheim Chalcot interview question

Wanted to write code on string manipulation but online on plain notepad like IDE.