Pergunta de entrevista da empresa Yext

Given a tree and a target node, find all cousin nodes that don't share the same parent as the target node.