You are building an application composed of multiple services, where each service may rely on one or more other services, forming a directed acyclic graph (DAG) of dependencies. One of these services serves as the entry point that receives user requests and, upon receiving a request, calls each of its dependencies. These dependencies then call their own dependencies, and so on.
The load factor of a service is defined as the number of units of load it must handle when the entry point receives 1 unit of load, assuming all upstream services issue their requests simultaneously. When multiple paths lead to the same service, the corresponding loads accumulate.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected