Cisco interview question

leet code medium about string manipulation