Amazon interview question

Two DSA questions (two pointers problem and a binary tree problem)