Longest Name Chain in a DAG
Given a set of directed relationships between names, each relationship {a, b} means that name a can be followed by name b. All relationships form a directed acyclic graph (DAG).
Find the lo...
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
