mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-14 01:49:41 +01:00
12 lines
169 B
Go
12 lines
169 B
Go
|
package main
|
||
|
|
||
|
func findCenter(edges [][]int) int {
|
||
|
u, v := edges[0][0], edges[0][1]
|
||
|
s, t := edges[1][0], edges[1][1]
|
||
|
|
||
|
if u == s || u == t {
|
||
|
return u
|
||
|
}
|
||
|
return v
|
||
|
}
|