We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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).
n
l
0
n-1
The text was updated successfully, but these errors were encountered:
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.
Sorry, something went wrong.
vaskoz
No branches or pull requests
Good morning! Here's your coding interview problem for today.
This question was asked by Google.
Given an integer
n
and a list of integersl
, write a function that randomly generates a number from0
ton-1
that isn't inl
(uniform).The text was updated successfully, but these errors were encountered: