Apolis interview question

They asked me to solve a simple java array challenge