Company: Linkedin_31aug
Difficulty: medium
Maximum Reliability Connections Problem Description A distributed system is represented as a connected tree graph with the following properties: g_nodes servers numbered from 0 to g_nodes - 1 . g_nodes - 1 connections forming a tree structure. Each connection links servers g_from[i] and g_to[i] with reliability g_weight[i] . To reduce maintenance costs, the developers need to remove some connections so that no server has more than k connections attached to it. Your task is to: Determine which connections to remove. Ensure no server has more than k connections after removal. Calculate the maximum possible total reliability (sum of g_weight values) of the remaining connections. Note: The total reliability is the sum of the g_weight values for all connections that remain after the removal process. Complete the function getMaxReliability with the following parameters: int k : An integer representing the maximum allowed connections per server. int g_nodes : The number of nodes (servers) in