Pregunta de entrevista de BlackRock

Basic string manipulation question in any language