I start with a list of integers:
A = [ 1, 2, 5, 3, 4, 6, 7, 8 ]
After a shuffle, I would like some elements (say 3,4 and 5) to preserve their occurrence (not location) while the rest are free to be randomly shuffled. Something like:
Outcome #1: A = [ 5, 2, 3, 1, 8, 4, 6, 7 ]
-or-
Outcome #2: A = [ 7, 5, 6, 1, 3, 4, 8, 2 ]
Appreciate all suggestions!
Aucun commentaire:
Enregistrer un commentaire