keshavMM004/InterviewQuest

GOOGLE interview quesion

開放

#5 建立於 2024年10月7日

 (0 則留言) (0 個反應) (0 位負責人)Java (0 個分叉)auto 404
hacktoberfest

倉庫指標

星標
 (0 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

A company has n employees, each assigned a unique ID ranging from 0 to n - 1, with the head of the company identified by headID.

Each employee has a direct manager, as specified in the manager array, where manager[i] indicates the direct manager of the i-th employee, and manager[headID] is set to -1. It is guaranteed that the reporting structure forms a tree.

The head of the company needs to notify all employees about urgent news. He will inform his direct subordinates, who will then pass the information to their own subordinates, continuing this process until everyone is informed.

The i-th employee requires informTime[i] minutes to notify all of his direct reports. This means that after informTime[i] minutes, his subordinates can begin spreading the news.

Return the total number of minutes required to inform all employees about the urgent news.

leetcode

貢獻者指南