Flipkart interview question

Warm up question about an array from cracking the coding interview (literally)