Suppose I have two arrays:

a = [1, 2, 3, 4] b = [5, 6, 7, 8, 9]

I want to interleave these two arrays to a variable 'c' (note 'a' and 'b' aren't necessarily of equal length) but I don't want them interleaved in a deterministic way. In short, it isn't enough to just zip these two arrays. I don't want:

c = [1, 5, 2, 6, 3, 7, 4, 8, 9]

Instead, I want something random like:

c = [5, 6, 1, 7, 2, 3, 8, 4, 9]

Also notice that the order of 'a' and 'b' are preserved in the resulting array, 'c'.

The current solution I have requires a for loop and some random number generation. I don't like it and I'm hoping someone can point me to a better solution.