Pergunta de entrevista da empresa Google

Algorithm question about parsing and encrypting strings