Amazon Interview Question

Don't remember specifically but Leetcode Medium difficulty level