Amazon interview question

LPs and then LeetCode medium