I want to create same sized smaller arrays from a big array. But items should distribte randomly. I can distribute by order like following:
int[] source = new[] { 10, 20, 30, 40, 50, 60, 70, 80, 90 };
int i = 0;
int chunkSize = 3;
var result = source.GroupBy(s => i++ / chunkSize).Select(g => g.ToArray()).ToArray();
// [10,20,30][40,50,60][70,80,90]
But result should be random like: // [90,20,50][70,30,60][40,80,10]
Can I do it using linq?