Amazon interview question

Leetcode based questions most likely easy to medium