human
Longest sub | Function to return the length of the largest subsequence with minimum possible LCM.
Minimum value from the array.
To store the frequency of the minimum element in the array.
If current element is equal to the minimum element.
Driver code"
Solution in Python:
assistant
#Here is code to longest sub and the other steps required.
 def maxLen ( arr , n ) :
	min_val = min ( arr ) ;
	freq = 0 ;
	for i in range ( n ) :
		if ( arr [ i ] == min_val ) :
			freq += 1 ;
	return freq ;
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 3 , 1 ] ;
	n = len ( arr ) ;
	print ( maxLen ( arr , n ) ) ;