Pregunta de entrevista de Figma

bfs with tree, recursion problem