1376. Time Needed to Inform All Employees
After reading the problem at the beginning, you can probably feel that DFS should be used to solve it. Use DFS to calculate the sum of each inform time from headID to a leaf, and finally take the maximum time.