Company: Cisco
Difficulty: medium
A distributed system of servers is represented as a tree with tree_nodes , numbered from 1 to tree_nodes . Moving between directly connected servers takes 1 unit of time. A process needs to: Start at the start_node server. Complete tasks at servers listed in an array task_nodes[] of size num_tasks by visiting servers in any order. End at the end_node server. Determine the minimum time required to complete all tasks and reach the end_node server. Note: Edges are bidirectional. It is guaranteed that task_nodes[] contains distinct elements. It is guaranteed that start_node is not equal to end_node and it is not present in task_nodes[] . Example tree_nodes = 4 tree_from = [1, 2, 2] tree_to = [3, 3, 4] start_node = 1, end_node = 2 num_tasks = 1 task_nodes = [4] One of the possible paths is: 1 -> 3 -> 2 -> 4 -> 2 Hence, the total time taken is 4. Function Description Complete the function getMinimumTime in the editor below. Function parameters: int tree_nodes : the number of node