Time Needed To Inform Problem

Time Needed To Inform Problem — ExecCode Medium DSA Practice

Solve the Time Needed To Inform problem on ExecCode. Free online medium DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Practice companion for CodeFlow time-needed-to-inform.

Examples

Input {"n": 6, "headID": 2, "manager": [2, 2, -1, 2, 2, 2], "informTime": [0, 0, 1, 0, 0, 0]}; Output 1. Input {"n": 2, "headID": 0, "manager": [-1, 0], "informTime": [6, 0]}; Output 6. Input {"n": 3, "headID": 0, "manager": [-1, 0, 0], "informTime": [1, 5, 7]}; Output 8

Constraints

1 ≤ n ≤ 10^5

Practice Time Needed To Inform free on ExecCode. Browse DSA problems, topic map, and placement guides.