Morgan Stanley Interview Question

Leetcode easy or medium working with arrays