Amazon interview question

They asked to solve an arrays and string problem.