Citadel interview question

Array problems, not very hard