1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
// @Title: 找出星型图的中心节点 (Find Center of Star Graph)
// @Author: 15816537946@163.com
// @Date: 2022-02-18 00:49:02
// @Runtime: 108 ms
// @Memory: 15.6 MB
func findCenter(e [][]int) int {
	if e[0][0] == e[1][0] || e[0][0] == e[1][1] {
		return e[0][0]
	}
	return e[0][1]
}