Pergunta de entrevista da empresa Persistent Systems

1 coding question on strings