Amazon interview question

Leetcode easy to medium level problems.