1.讲解
根据题意每组[ui, vi]中必有一个是相同的,所以比较一二两组的相同元素输出即可
2.代码
class Solution {
public int findCenter(int edges) {
if (edges0==edges1||edges1==edges0)
return edges0;
else
return edges0;
}
}
标签:return,题意,int,18,力扣,edges0,edges1,星型,2022.2
来源: https://www.cnblogs.com/fjyunyou/p/15907191.html