Pergunta de entrevista da empresa Meta

Tree traversal with added roles and complexities