Thoughtworks interview question

The first coding round had a very easy array problem.