In a party of n people, a celebrity is someone who is known by everyone else but knows no one. Given a helper function knows(A, B) that returns true if A knows B, find the celebrity in O(n) time using…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.