human
Longest Arithmetic Progression | DP | The function returns true if there exist three elements in AP Assumption : set [ 0. . n - 1 ] is sorted . The code strictly implements the algorithm provided in the reference ..
One by fix every element as middle element.
Initialize i and k for the current j.
Find if there exist i and k that form AP with j as middle element"
How can the above be solved in Python?

=====
Can you provide a code to longest Arithmetic Progression and the other steps required?
assistant
#Here is code to longest Arithmetic Progression and the other steps required.
 def arithematicThree ( set_ , n ) :
	for j in range ( n ) :
		i , k = j - 1 , j + 1
		while i > - 1 and k < n :
			if set_ [ i ] + set_ [ k ] == 2 * set_ [ j ] :
				return True
			elif set_ [ i ] + set_ [ k ] < 2 * set_ [ j ] :
				i -= 1
			else :
				k += 1
	return False