Thread Count (Also for Infra Automation Intern)
There are service_nodes of different micro-services in a system with bidirectional connections in the form of a tree, where the ith edge connects the micro-service service_from[j] and service_to[j]. Each micro-service is configured with a maximum number of live threads that can be present in its lifecycle, where the ith micro-service can have a maximum of threads[j] threads. The micro-services adjacent to each other must have maximum threads differing by exactly 1. Some configurations were lost, and only k of the micro-services are known. This information is given as a 2D array, currentValues, of size k x 2 denoting [micro-service index, maximum threads], or, [i, threads[i]].
Find the maximum number of live threads that each micro-service can have such that the total number of live threads in the system is the minimum possible. Return an array of length service_nodes where the ith element denotes the maximum number of live threads for the ith micro-service.
Note: It is guaranteed that the solution always exists.
1Example 1

Constraints
Limits and guarantees your solution can rely on.
1 ≤ service_nodes ≤ 10^61 ≤ service_from[i], service_to[i] ≤ service_nodes1 ≤ k ≤ service_nodes1 ≤ currentValues[i][0] ≤ service_nodes1 ≤ currentValues[i][1] ≤ 10^6