Home > AI > Language > Python >

(interview) Stream Shuffling

1
2
3
4
5
6
7
8
9
10
11
12
13
## Stream Shuffling
 
Using only `random`, implement the Fisher Yates shuffling algorithm that can work on an input stream.
 
```py
import random
 
input_stream = range(0, 100)
output_list = []
 
for (i, v) in enumerate(input_stream):
    pass
```

Leave a Reply