human
Count smaller elements on right side | .
initialize all the counts in countSmaller array as 0.
Utility function that prints out an array on a line.
Driver code"
Solution in Python:

What is a code to count smaller elements on right side and the other steps required?
assistant
#Here is code to count smaller elements on right side and the other steps required.
 def constructLowerArray ( arr , countSmaller , n ) :
	for i in range ( n ) :
		countSmaller [ i ] = 0
	for i in range ( n ) :
		for j in range ( i + 1 , n ) :
			if ( arr [ j ] < arr [ i ] ) :
				countSmaller [ i ] += 1
def printArray ( arr , size ) :
	for i in range ( size ) :
		print ( arr [ i ] , end = " ▁ " )
	print ( )
arr = [ 12 , 10 , 5 , 4 , 2 , 20 , 6 , 1 , 0 , 2 ]
n = len ( arr )
low = [ 0 ] * n
constructLowerArray ( arr , low , n )
printArray ( low , n )