Amazon Interview Question

2 easy / medium leetcode problems