Fresherworld.com interview question

Array related problem basic of ops