Count Trigger Events in Directed Acyclic Graph

Given a directed acyclic graph with a specified entry point, each trigger of the entry point triggers its child nodes once and continues to trigger subsequent nodes. Calculate the trigger count for al...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: