1791. 找出星型图的中心节点

exiaohu 于 2022-02-18 发布

题目链接:1791. 找出星型图的中心节点

找到第一条边和第二条边的共同结点即可。

from typing import List


class Solution:
    def findCenter(self, edges: List[List[int]]) -> int:
        return set(edges[0]).intersection(edges[1]).pop()