Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day 333 #668

Closed
vaskoz opened this issue Jul 22, 2019 · 0 comments · Fixed by #731
Closed

Day 333 #668

vaskoz opened this issue Jul 22, 2019 · 0 comments · Fixed by #731
Assignees

Comments

@vaskoz
Copy link
Owner

vaskoz commented Jul 22, 2019

Good morning! Here's your coding interview problem for today.

This problem was asked by Pinterest.

At a party, there is a single person who everyone knows, but who does not know anyone in return (the "celebrity"). To help figure out who this is, you have access to an O(1) method called knows(a, b), which returns True if person a knows person b, else False.

Given a list of N people and the above operation, find a way to identify the celebrity in O(N) time.

@vaskoz vaskoz self-assigned this Jul 22, 2019
@vaskoz vaskoz mentioned this issue Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant