Time Needed to Inform All Employees

A company has n employees in a tree. Employee i has manager manager[i], and the head has manager -1. When an employee finishes informing direct subordinates, those subordinates start at once. informTime[i] is the time employee i needs to inform all direct subordinates. Given n, headID, manager, and informTime, return the time needed to inform every employee.

Examples
Input: [6,2,[2,2,-1,2,2,2],[0,0,1,0,0,0]]
Output: 1
Hints

Time Needed to Inform All Employees

A company has `n` employees in a tree. Employee `i` has manager `manager[i]`, and the head has manager `-1`. When an employee finishes informing direct subordinates, those subordinates start at once. `informTime[i]` is the time employee `i` needs to inform all direct subordinates. Given `n`, `headID`, `manager`, and `informTime`, return the time needed to inform every employee.