Find the Town Judge (LeetCode 997): given trust relationships among n people, identify the town judge who trusts nobody and is trusted by everyone else; explain approach, code it, and dry run on the examples.
Asked in the Technical coding interview stage. Linked LeetCode problem; candidate explained approach first, then coded and dry-ran. Reported follow-ups: Clarifications on the coding style; dry run for given examples.
Implement find_judge(n, trust). People are labeled 1 through n; each [a, b] means person a trusts person b. Return the judge's label, or -1 if no judge exists.
def find_judge(n, trust):