1791. Find Center of Star Graph

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1791

class Solution:
    def findCenter(self, edges: List[List[int]]) -> int:
        return edges[0][0] if edges[0][0] in edges[1] else edges[0][1]