Pregunta de entrevista de Meta

Tree traversal with added roles and complexities