Pergunta de entrevista da empresa Galatea Associates LLC

Typical algorithm problem involving strings