NETGEAR interview question

Array manipulation problem