Amazon interview question

to solve dsa problems from leetcode