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