Chain of Command — Longest Chain Length

Asked at IMC Trading · Coding Questions · Difficulty: Medium

Given a company's employee relationship graph, each directed edge `(u, v)` represents that employee `u` is a direct leader of employee `v`. Calculate the length of the longest command chain across all employee chains (the number of nodes on the longest directed path in the DAG).

Loading the problem…