I have a java list, example:
a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]
I want to shuffle it but within n size bins within. From bin, I meant, I want to shuffle first 5 elements, then next 5 and so on.. So, one of the the expected result will be:
sorted = [3,5,4,2,1, 8,9,7,10,6, 14,11,12,15,13, 19,20,17,18,16, 22,21]
How can I do it efficiently