Amazon Interview Question

Leetcode Medium question on Arrays