Pregunta de entrevista de Meta

Tree question and an array question