Chain of Command

Given a company's employee relationship graph, each edge (u,v) represents employee u is a direct leader of employee v. Calculate the longest command chain length in all employee chains.

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: