Premium Only Content

Leetcode solving: 997. Find the Town Judge
Leetcode solving: 997. Find the Town Judge
Please subscribe to my channel
In a town, there are n people labelled from 1 to n. There is a rumor that one of these people is secretly the town judge.
If the town judge exists, then:
The town judge trusts nobody.
Everybody (except for the town judge) trusts the town judge.
There is exactly one person that satisfies properties 1 and 2.
You are given trust, an array of pairs trust[i] = [a, b] representing that the person labelled a trusts the person labelled b.
If the town judge exists and can be identified, return the label of the town judge. Otherwise, return -1.
##############
My other Leetcode solving videos (easy)
https://www.youtube.com/playlist?list=PLg9w7tItBlZt4oUpNyWU_0rOItlScu1_d
Leetcode solving videos (Medium):
https://www.youtube.com/playlist?list=PLg9w7tItBlZvMGxy-y1eXURPD6Ao6kkzA
Leetcode solving videos (Hard):
https://www.youtube.com/playlist?list=PLg9w7tItBlZt4JQmlkGD3M5idZn14NyL6
############
-
25:26
World2Briggs
17 hours ago $0.63 earnedTop 15 Most Visited Cities in the World
3.88K -
LIVE
BEK TV
22 hours agoTrent Loos in the Morning - 9/05/2025
274 watching -
LIVE
The Bubba Army
21 hours agoTyson vs Mayweather SUPERFIGHT! - Bubba the Love Sponge® Show | 9/05/25
4,001 watching -
LIVE
FyrBorne
1 hour ago🔴Warzone M&K Sniping: This May Be The Most Broken Update Yet
87 watching -
10:59
Degenerate Jay
15 hours ago $1.45 earned007 First Light Is The James Bond Game Fans Deserve
19K2 -
9:11
Faith Frontline
14 hours agoTucker Carlson SHOCKED As Cliffe Knechtle Reveals God’s Chosen People
6.81K4 -
23:10
Jasmin Laine
16 hours agoCTV Host Visibly UNCOMFORTABLE As Guest Calls Canadians RACIST—Poilievre Leaves Them SPEECHLESS
12K4 -
20:18
Fit'n Fire
16 hours ago $0.29 earned*NEW* CZ P10C OR Ported -- First 500 Rounds
7.32K1 -
14:41
Nate The Lawyer
1 day ago $0.95 earnedWhy Hasn’t Raja Jackson Been Arrested Yet?
9.49K15 -
6:04
Buddy Brown
2 days ago $1.21 earnedEugene’s SICK Newspaper Cover is a WARNING to Us All! | Buddy Brown
10.8K10