Wipro interview question

Solving a Array problem and get the result