Amazon interview question

Leet code questions from easy and medium