In a town with n people labeled from 1 to n, there is a rumor about a town judge. The town judge trusts nobody, while everyone else trusts the town judge. Only one person can satisfy these conditions. An array 'trust' represents trust relationships between people. The task is to identify the town judge or return -1 if they do not exist.
Click Run to execute sample tests.