Pergunta de entrevista da empresa Samsung Electronics America

A basic string manipulation question.