NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

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.

Test Cases
Input
Output
Expected