Amazon interview question

complex leetcode problems on string and tree