Amazon Interview Question

2 Leetcode easy problems + 1 medium