Amazon Interview Question

Leetcode style coding questions as usual