Re: [閒聊] 每日LeetCode

作者: wu10200512 (廷廷)   2024-02-22 22:35:39
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;
}
};
作者: JIWP (JIWP)   2023-02-22 22:35:00
大師
作者: DJYOSHITAKA (Evans)   2024-02-22 22:36:00
大施
作者: HccrtZ (Violet)   2024-02-22 22:36:00
什麼時候去咕咕嚕賺錢養我
作者: JIWP (JIWP)   2024-02-22 22:36:00
什麼時後能內推我
作者: kazunerae (数狙え)   2024-02-22 22:37:00
我two sum submit了40次
作者: sustainer123 (caster)   2024-02-22 22:37:00
我不會two sum
作者: Niuromem   2024-02-22 22:41:00
大濕

Links booklink

Contact Us: admin [ a t ] ucptt.com