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
############
-
43:54
VINCE
2 hours agoThomas Speciale: The Man Behind John Brennan's Meltdown | Episode 167 - 11/12/25 VINCE
42.8K96 -
LIVE
Nikko Ortiz
1 hour agoMILITARY FAILS AND KAREN ACTIVITIES... |Rumble Live
350 watching -
LIVE
Wendy Bell Radio
7 hours agoMAGA's Wake Up Call
6,675 watching -
22:16
iCkEdMeL
1 hour agoBREAKING: Road Rage Shooting Reported on San Antonio’s East Side | LIVE Scene
4.4K -
1:16:23
Graham Allen
3 hours agoThe United States of Islam?! We Are Being INVADED!!! + ANTIFA Must End NOW!!
148K1.52K -
LIVE
Viss
2 hours ago🔴LIVE - ARC RAIDERS Befriend or Betray? Chat Decides!
202 watching -
1:10:29
Chad Prather
17 hours agoFailure and the God Who Restores
82.1K27 -
LIVE
SOLTEKGG
1 hour ago🔴 LIVE - 30+ KILL FOR 60 GIFTED SUBS - Battlefield 6
57 watching -
2:35:03
Matt Kohrs
13 hours agoStock Market Open: Record Highs Incoming 🚀🚀🚀 || Live Trading $1M
12.2K -
LIVE
GloryJean
1 hour agoRedSec BEAST Putting in Reps
37 watching