Daily challenge for 2025-10-11
284. Find the Town Judge
In a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge. If the town judge exists, then:
1. The town judge trusts nobody.
2. Everybody (except for the town judge) trusts the town judge.
3. There is exactly one person that satisfies properties 1 and 2.
You are given an array trust where trust[i] = [a, b] represents that person a trusts person b. Return the label of the town judge if exists, or -1 otherwise.
Example:Input: n = 3, trust = [[1,3],[2,3]]Output: 3
Run this challenge interactively in Python or JavaScript when the app loads.