keshavMM004/InterviewQuest

GOOGLE interview quesion

オープン

#5 opened on 2024/10/07

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Java (0 件のフォーク)auto 404
hacktoberfest

Repository metrics

Stars
 (0 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド