human
Shuffle 2 n integers in format { a1 , b1 , a2 , b2 , a3 , b3 , ... ... , an , bn } without using extra space | Function to shuffle an array of size 2 n.
Rotate the element to the left.
swap a [ j - 1 ] , a [ j ].
Driver Code"
Solution in Python:
assistant
#Here is code to shuffle 2 n integers in format { a1 , b1 , a2 , b2 , a3 , b3 , .
 def shuffleArray ( a , n ) :
	i , q , k = 0 , 1 , n
	while ( i < n ) :
		j = k
		while ( j > i + q ) :
			a [ j - 1 ] , a [ j ] = a [ j ] , a [ j - 1 ]
			j -= 1
		i += 1
		k += 1
		q += 1
a = [ 1 , 3 , 5 , 7 , 2 , 4 , 6 , 8 ]
n = len ( a )
shuffleArray ( a , int ( n / 2 ) )
for i in range ( 0 , n ) :
	print ( a [ i ] , end = " ▁ " )