diff --git a/Sample.java b/Sample.java new file mode 100644 index 0000000..ecad299 --- /dev/null +++ b/Sample.java @@ -0,0 +1,85 @@ +class Sample{ + /***********PROBLEM-1***********/ + + /***********PROBLEM-2***********/ + /* The knows API is defined in the parent class Relation. + boolean knows(int a, int b); */ +//TC:0(N*N) +//SC:0(N) + public class Solution extends Relation { + public int findCelebrity(int n) { + int[] incoming=new int[n]; + int[] outgoing=new int[n]; + for(int i=0;i