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 order of occurrence in A while the rest of the elements 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 ]
-but not-
Outcome #3 (invalid outcome) A = [7, 4, 6, 1, 3, 5, 8, 2]
Appreciate all suggestions!