Pregunta de entrevista de Amazon

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