A company has n employees with unique ids 0 to n - 1, and headID is the head of the company. manager[i] is the direct manager of employee i (manager[headID] = -1), and the subordination forms a tree. The head wants to share urgent news. Employee i needs informTime[i] minutes to inform all of their direct subordinates, after which those subordinates start spreading it further. Return the number of minutes needed to inform all employees.
A company has n employees with unique ids 0 to n - 1, and headID is the head of the company. manager[i] is the direct manager of employee i (manager[headID] = -1), and the subordination forms a tree. The head wants to share urgent news. Employee i needs informTime[i] minutes to inform all of their direct subordinates, after which those subordinates start spreading it further. Return the number of minutes needed to inform all employees.