human
LCM of given array elements | Recursive function to return gcd of a and b.
recursive implementation.
lcm ( a , b ) = ( a * b / gcd ( a , b ) ).
Driver code"
Solution in Python:
 ... Can you provide a code to lCM of given array elements and the other steps required?
assistant
#Here is code to lCM of given array elements and the other steps required.
 def __gcd ( a , b ) :
	if ( a == 0 ) :
		return b
	return __gcd ( b % a , a )
def LcmOfArray ( arr , idx ) :
	if ( idx == len ( arr ) - 1 ) :
		return arr [ idx ]
	a = arr [ idx ]
	b = LcmOfArray ( arr , idx + 1 )
	return int ( a * b / __gcd ( a , b ) )
arr = [ 1 , 2 , 8 , 3 ]
print ( LcmOfArray ( arr , 0 ) )
arr = [ 2 , 7 , 3 , 9 , 4 ]
print ( LcmOfArray ( arr , 0 ) )