Skip to content

Commit 91ea93f

Browse files
add a solution for 997
1 parent b9a4202 commit 91ea93f

File tree

1 file changed

+3
-0
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+3
-0
lines changed

src/main/java/com/fishercoder/solutions/_997.java

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public int findJudge(int n, int[][] trust) {
2525
public static class Solution2 {
2626
/**
2727
* Credit: https://leetcode.com/problems/find-the-town-judge/solution/ solution 2
28+
* Also, note: is it possible to have more than one town judges?
29+
* No! It's impossible! If it's possible, suppose there are two town judges, then both of them have to be trusted by everyone else which includes the other judge.
30+
* Otherwise, we'ld have a town judge not trusted by everybody.
2831
*/
2932
public int findJudge(int n, int[][] trust) {
3033
if (trust.length < n - 1) {

0 commit comments

Comments
 (0)