from typing import List


def findJudge_v2(N: int, trust: List[List[int]]) -> int:
    """
    This version is inspired by a post found in a LeetCode discussion.
    https://leetcode.com/explore/featured/card/may-leetcoding-challenge/535/week-2-may-8th-may-14th/3325/discuss/244859/Python-O(n)-with-Explanation
    It is less complicated, and it is slightly faster.
    Complexity: O(n)
    """
    confidence = {b: 0 for b in range(1, N + 1)}
    for a, b in trust:
        confidence[a] -= 1
        confidence[b] += 1
    judge = {a for a, b in confidence.items() if b == N - 1}
    return -1 if not judge else judge.pop()