human
Make all array elements equal by repeated subtraction of absolute difference of pairs from their maximum | Function to return gcd of a and b.
Base Case.
Recursive call.
Function to find gcd of array.
Initialise the result.
Traverse the array arr [ ].
Update result as gcd of the result and arr [ i ].
Return the resultant GCD.
Given array arr [ ].
Function call"
Solution in Python:
 ... Give me a code to make all array elements equal by repeated subtraction of absolute difference of pairs from their maximum and the other steps required?
assistant
#Here is code to make all array elements equal by repeated subtraction of absolute difference of pairs from their maximum and the other steps required.
 def gcd ( a , b ) :
	if ( a == 0 ) :
		return b
	return gcd ( b % a , a )
def findGCD ( arr , N ) :
	result = 0
	for element in arr :
		result = gcd ( result , element )
		if ( result == 1 ) :
			return 1
	return result
arr = [ 2 , 3 , 4 ]
N = len ( arr )
print ( findGCD ( arr , N ) )