Safaricom Interview Question

Write an algorithm to solve a simple string problem