You'll solve your first graph problem. Problem: Find the Town Judge This problem tests your understanding of directed degrees. Someone is the judge only if everyone else trusts them (high in-degree) and they trust nobody (zero out-degree).
You will translate this observation into code using degree counting. No fancy algorithm needed, track in-degrees and out-degrees for each person. If exactly one person has in-degree and out-degree , that person is the judge.