Hexaware Technologies interview question

Arrays based medium level question