Daily challenge for 2026-02-21
417. Find Center of Star Graph
There is an undirected star graph consisting of n nodes labeled from 1 to n. A star graph is a graph where there is one center node connected to every other node and no other edges exist. You are given a 2D integer array edges where each edges[i] = [u, v] indicates that there is an edge between the nodes u and v. Return the center of the given star graph.
Example:
Input: edges = [[1,2],[2,3],[4,2]]
Output: 2
Explanation: Node 2 is connected to 1, 3, and 4.
Run this challenge interactively in Python or JavaScript when the app loads.