In an access‑control system, each role may have privileges explicitly allowed or disallowed, and can inherit privileges from other roles. Given a hierarchy of roles (a Directed Acyclic Graph) and per‑role allowed/disallowed privilege lists, determine the final set of privileges each role is permitted.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected