You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/fishercoder/solutions/_277.java
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
You are given a helper function bool knows(a, b) which tells you whether A knows B. Implement a function int findCelebrity(n), your function should minimize the number of calls to knows.
7
7
Note: There will be exactly one celebrity if he/she is in the party. Return the celebrity's label if there is a celebrity in the party. If there is no celebrity, return -1.
8
8
*/
9
-
publicclassFindtheCelebrity {
9
+
publicclass_277 {
10
10
11
11
publicintfindCelebrity(intn) {
12
12
intcandidate = 0;
@@ -24,6 +24,4 @@ public int findCelebrity(int n) {
0 commit comments