Interview Query

Random Number

1
Have you seen this question before?

Given a stream of numbers, select a random number from the stream, with O(1)O(1) space in selection.

Next question: 1000 Sample Classifier
.....
Python 3.9.6
Loading editor
Use Shift + Enter to run code