Given n people, find the celebrity who is known by everyone but knows nobody, or return -1.
Suppose you are at a party with n people labeled 0 to n-1. There is a "knows" API that returns whether person a knows person b. Find the celebrity if one exists:
Everyone knows the celebrity
The celebrity knows no one
If no celebrity exists, return -1.
Examples
Input:[[],0]
Output:[0,0,0,0,0]
Input:[[0],0]
Output:[0,0,0,0,1]
Hints
Use the knows API to eliminate non-candidates.
If candidate knows anyone, they're not a celebrity.
If anyone doesn't know candidate, they're not a celebrity.