You are given a tree with edges of length edges[i]
You are also given an integer array baseTime of length baseTime[i] represents the base execution time of task
The tasks are executed according to the following rules:
If a task is a leaf node (it has no children), its finish time is equal to baseTime[i].
If a task has children, let earliest and latest be the minimum and maximum finish times among all its direct children, respectively.
The duration of the task itself is calculated as:
Return the finish time of task
Constraints:
The input represents a valid tree rooted at node
You are given a tree with edges of length edges[i]
You are also given an integer array baseTime of length baseTime[i] represents the base execution time of task
The tasks are executed according to the following rules:
If a task is a leaf node (it has no children), its finish time is equal to baseTime[i].
If a task has children, let earliest and latest be the minimum and maximum finish times among all its direct children, respectively.
The duration of the task itself is calculated as:
Return the finish time of task
Constraints:
The input represents a valid tree rooted at node