Thoughtworks Interview Question

The first coding round had a very easy array problem.