Company: Service_now_16nov
Difficulty: medium
Neural Network Neuron Vigor Problem Description A neural network has n neurons numbered from 1 to n. If the i-th neuron has strong connectivity, strongConnectivity[i] = 1. If it has weak connectivity, strongConnectivity[i] = 0. The neurons form a tree-like network with n-1 connections, where the i-th connection connects neuron neuronFrom[i] and neuronTo[i]. A neuron's strength is defined as the maximum difference between strongly connected and weakly connected neurons in any subnetwork including that neuron. Return an array of n integers, where the i-th integer represents the strength of neuron i. Note: A subnetwork is a connected subgraph of the given network. Complete the function `getNeuronStrengths` in the editor with the following parameter(s): int n: the total number of neurons int neuronFrom[n-1]: the one end of the connections int neuronTo[n-1]: the other end of the connections int strongConnectivity[n]: the strength of each neuron's connectivity, with 1 representing strong and