J.P. Morgan Interview Question

Just one simple array problem, and follow up around that problem