Back to Question

Find the Town Judge (Array/Map)

Question Explain

In a town of $N$ people, the judge trusts nobody and is trusted by everyone. Find the judge by tracking in-degrees (trusted by) and out-degrees (trusts) using an array or map.

Start Trying This Question Simulation

Click "Start Speaking" and answer the question naturally.