Amazon interview question

There were two coding questions, leetcode easy and medium