N employess in a party and one of them is CEO of the company. Identify who is the CEO?
Given that CEO is the ONLY person who satisfies these condition:
a) Every other employee knows CEO.
b) CEO knows no one.
You are given an API, bool knows(int emp1, int emp2) which will return true if emp1 knows emp2.
I was able to come up with Time O(N^2) and Space O(1) complexity. But interviewer wanted Time complexity to be better.