PayPal | Phone | Find Celebrity & Move Zeroes
3305
Jun 10, 2020
Jun 18, 2020
-
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 returntrueifemp1knowsemp2.I was able to come up with Time O(N^2) and Space O(1) complexity. But interviewer wanted Time complexity to be better.
Comments (6)


