Back to problems

Compute Effective Letter Permissions in a DAG

Algorithm · Snowflake · Hard

You are given a directed acyclic graph. Each vertex has a direct allowed-letter string and a direct disallowed-letter string. A letter that is directly allowed at a vertex is inherited by every descendant along all ancestor paths. Disallow declarations are local to the vertex that declares them. For each vertex, combine the direct allow strings from the vertex and all of its ancestors, then subtract only that vertex's own direct disallow string. Each entry of nodes has the…

Checking your access…