Company: Ethos_2march
Difficulty: medium
Maximum Difference Problem Description Given a number of nodes and edges, construct an undirected graph. A connected component of the graph is any group of connected nodes. For each connected component, determine the difference between its maximum and minimum value. Return the maximum of all these differences. For example, given a graph with 4 nodes, connected as follows: [1, 2], [3, and [4]. The only connected component has a difference 3 - 1 = 2. Function Description Complete the function maximumDifference in the editor below. The function must return an integer denoting the maximum difference between the minimum and maximum node values in any connected component. The function signature is: int maximumDifference(int g_nodes, vector<int> g_from, vector<int> g_to) { } maximumDifference has the following parameter(s): int g_nodes : the number of nodes vector<int> g_from : one end of a connected pair of nodes vector<int> g_to : the other end of a connected pair of