Validate an Employee Hierarchy and Find the Maximum Root-to-Employee Distance

You are given n employees labeled from 0 to n - 1.

  • manager[i] is the direct manager of employee i. The root employee (CEO) has manager[i] = -1.
  • informTime[i] is the time employee `i...

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: