Amazon interview question

Leetcode based question only and self intro