DEV Community

Discussion on: An algorithm for picking random numbers in a range without repetition

Collapse
 
jonathanschuma profile image
Jonathan

What if on 5 we roll 3 -> return 3.
Then on 4 we roll 3 -> return 5, delete map.
Then on 3 we roll 3 -> return?, no more map, index to swap with is also 3.

Collapse
 
babak profile image
Babak

Test these assumptions :-)