Morgan Stanley Interview Question

Array question