Re: [閒聊] 每日LeetCode已回收
easy submit了四次才對
我這輩子就這樣了
嗚嗚哇哇哇
997. Find the Town Judge
class Solution {
public:
int findJudge(int n, vector<vector<int>>& trust) {
vector<int> trusting(n+1, 0);
vector<int> trusted(n+1, 0);
for(auto& t:trust){
trusting[t[0]]++;
trusted[t[1]]++;
}
for(int i=1; i<n+1; i++){
if(trusting[i]==0 && trusted[i]==n-1) return i;
}
return -1;
}
};
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.230.40.89 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Marginalman/M.1708612541.A.43B.html
推
02/22 22:35,
1年前
, 1F
02/22 22:35, 1F
推
02/22 22:36,
1年前
, 2F
02/22 22:36, 2F
推
02/22 22:36,
1年前
, 3F
02/22 22:36, 3F
→
02/22 22:36,
1年前
, 4F
02/22 22:36, 4F
推
02/22 22:37,
1年前
, 5F
02/22 22:37, 5F
推
02/22 22:37,
1年前
, 6F
02/22 22:37, 6F
→
02/22 22:41,
1年前
, 7F
02/22 22:41, 7F
討論串 (同標題文章)
完整討論串 (本文為第 708 之 719 篇):