human
Finding LCM of more than two ( or array ) numbers without using GCD | Returns LCM of arr [ 0. . n - 1 ].
Find the maximum value in arr [ ].
Initialize result.
Find all factors that are present in two or more array elements . x = 2.
Current factor ..
To store indexes of all array elements that are divisible by x ..
If there are 2 or more array elements that are divisible by x ..
Reduce all array elements divisible by x ..
Then multiply all reduced array elements.
Driver code"
How can the above be solved in Python?

Can you provide a code to finding LCM of more than two ( or array ) numbers without using GCD and the other steps required?
assistant
#Here is code to finding LCM of more than two ( or array ) numbers without using GCD and the other steps required.
 def LCM ( arr , n ) :
	max_num = 0 ;
	for i in range ( n ) :
		if ( max_num < arr [ i ] ) :
			max_num = arr [ i ] ;
	res = 1 ;
	while ( x <= max_num ) :
		indexes = [ ] ;
		for j in range ( n ) :
			if ( arr [ j ] % x == 0 ) :
				indexes . append ( j ) ;
		if ( len ( indexes ) >= 2 ) :
			for j in range ( len ( indexes ) ) :
				arr [ indexes [ j ] ] = int ( arr [ indexes [ j ] ] / x ) ;
			res = res * x ;
		else :
			x += 1 ;
	for i in range ( n ) :
		res = res * arr [ i ] ;
	return res ;
arr = [ 1 , 2 , 3 , 4 , 5 , 10 , 20 , 35 ] ;
n = len ( arr ) ;
print ( LCM ( arr , n ) ) ;