DEV Community

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

jonathanschuma profile image

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.

babak profile image
Babak Author

Test these assumptions :-)