You are building an application that consists of many different services that can depend on each other. One of these services is the entrypoint which receives user requests and then makes requests to each of its dependencies, which will in turn call each of their dependencies and so on before returning.
Given a directed acyclic graph that contains these dependencies, you are tasked with determining the load factor for each of these services. The load factor of a service is defined as the number of units of load it will receive if the entrypoint receives 1 unit of load.
For a given downstream service, its load factor is the number of units of load it is required to handle if all upstream services made simultaneous requests.
In the following dependency graph where dashboard is the entrypoint:
dashboard -> user, orders, recommendations recommendations -> user, orders orders -> user, foobar user -> logging
dashboard receives 1 unit → load factor = 1user is called by dashboard (1), orders (1), and recommendations (1), but orders is called by both dashboard and recommendations (2 total), so user gets 1 + 2 + 1 = 4 → load factor = 4logging is called by user, so it inherits user's load → load factor = 4orders is called by dashboard (1) and recommendations (1) → load factor = 2recommendations is called by dashboard → load factor = 1Important: Make sure you fully understand how load accumulates before proceeding. Each service passes its entire load to each of its dependencies.
service_list: An array of strings in the format "service_name=dependency1,dependency2". Dependencies can be blank (e.g. "dashboard="). Non-existent dependency references should be ignored. Each service is defined only once.entrypoint: An arbitrary service that is guaranteed to exist within the graph.Return a list of all services depended on by (and including) the entrypoint, as an array of strings formatted as "service_name*load_factor", sorted alphabetically by service name.