Pergunta de entrevista da empresa Safaricom

Write an algorithm to solve a simple string problem