Given the edges of a star graph, return the center node. Pattern focus: Degree. In a star graph, the center is the unique node with degree n - 1.
edges = edge list of a star graph
label of the center node
Example 1:
Input:
edges = [[1,2],[2,3],[4,2]]
Output:
2
Explanation:
Node 2 appears in every edge.
Example 2:
Input:
edges = [[1,2],[5,1],[1,3],[1,4]]
Output:
1
Explanation:
Node 1 has the highest degree.