human
Count of triplets ( a , b , c ) in the Array such that a divides b and b divides c | Function to count triplets.
Iterate for middle element.
Iterate left array for a [ i ].
Iterate right array for a [ k ].
Return the final result.
Driver code"
Solution in Python:

=====
Write me a code to count of triplets ( a , b , c ) in the Array such that a divides b and b divides c and the other steps required?
assistant
#Here is code to count of triplets ( a , b , c ) in the Array such that a divides b and b divides c and the other steps required.
 def getCount ( arr , n ) :
	count = 0
	for j in range ( 1 , n - 1 ) :
		p , q = 0 , 0
		for i in range ( j ) :
			if ( arr [ j ] % arr [ i ] == 0 ) :
				p += 1
		for k in range ( j + 1 , n ) :
			if ( arr [ k ] % arr [ j ] == 0 ) :
				q += 1
		count += p * q
	return count
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 2 , 2 ]
	N = len ( arr )
	print ( getCount ( arr , N ) )