Fix the ith element and iterate over all the array to find minimum LCM
for j in range ( i + 1 , n ) : NEW_LINE INDENT g = gcd ( arr [ i ] , arr [ j ] ) ; NEW_LINE lcm = arr [ i ] / g * arr [ j ] ; NEW_LINE ans = min ( ans , lcm ) ; NEW_LINE DEDENT return ans ; NEW_LINE