Pregunta de entrevista de Microsoft

Leetcode medium. Some array and tree questions.