Google interview question

Solve a question related to array