human
Count of lexicographically smaller characters on right | function to count the smaller characters at the right of index i.
store the length of String.
for each index initialize count as zero.
increment the count if characters are smaller than at ith index.
print the count of characters smaller than the index i.
Driver code.
input String"
Solution in Python:
assistant
#Here is code to count of lexicographically smaller characters on right and the other steps required.
 def countSmaller ( str ) :
	n = len ( str ) ;
	for i in range ( n ) :
		cnt = 0 ;
		for j in range ( i + 1 , n ) :
			if ( str [ j ] < str [ i ] ) :
				cnt += 1 ;
		print ( cnt , end = " ▁ " ) ;
if __name__ == ' _ _ main _ _ ' :
	str = " edcba " ;
	countSmaller ( str ) ;