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 90 #189

Closed
vaskoz opened this issue Nov 20, 2018 · 1 comment
Closed

Day 90 #189

vaskoz opened this issue Nov 20, 2018 · 1 comment
Assignees

Comments

@vaskoz
Copy link
Owner

vaskoz commented Nov 20, 2018

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

This question was asked by Google.

Given an integer n and a list of integers l, write a function that randomly generates a number from 0 to n-1 that isn't in l (uniform).

@vaskoz vaskoz self-assigned this Nov 20, 2018
@vaskoz
Copy link
Owner Author

vaskoz commented Nov 21, 2018

Since we can't assume the list of integers is sorted, we have to run in O(N) time. But I will assume the numbers in the list will be distinct.

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

No branches or pull requests

1 participant