Jet Interview Question

a algorithm question related to array