Company: uber_29oct
Difficulty: medium
Optimal Path Problem Description 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[] . Function Description Complete the function getMinimumTime in the editor below. Function parameters: int tree_nodes : the number of nodes in the tree int tree_from[tree_nodes-1] : the starting node of the edge int tree_to[tree_nodes-1] : the ending node of the edge int start_node : the starting node of the path int end_node