c++
-
c ++ who can show me the direction of this article. There is an undirected star graph consisting of nodes labeled 1 to n. A star graph is a graph in which there is a central node and exactly n - 1 edges connecting the central node to every other node. You are given a 2Dedges integer array where each edge edges[i] = [ui, vi] indicates that there is an edge between the nodes ui and vi. Returns the center of the given star graph. Input: edges = 4 1,2 5,1 1,3 1,4 Output: 1
-
c ++ who can show me the direction of this article. There is an undirected star graph consisting of nodes labeled 1 to n. A star graph is a graph in which there is a central node and exactly n - 1 edges connecting the central node to every other node. You are given a 2Dedges integer array where each edge edges[i] = [ui, vi] indicates that there is an edge between the nodes ui and vi. Returns the center of the given star graph. Input: edges = 4 1,2 5,1 1,3 1,4 Output: 1