human
Find a triplet in an array such that arr [ i ] arr [ k ] and i < j < k | Function to find a triplet that satisfy the conditions.
Traverse the given array.
Stores current element.
Stores element just before the current element.
Stores element just after the current element.
Check the given conditions.
Print a triplet.
If no triplet found.
Driver Code"
How can the above be solved in Python?

Write me a code to find a triplet in an array such that arr [ i ] arr [ k ] and i < j < k and the other steps required?
assistant
#Here is code to find a triplet in an array such that arr [ i ] arr [ k ] and i < j < k and the other steps required.
 def FindTrip ( arr , N ) :
	for i in range ( 1 , N - 1 ) :
		p = arr [ i - 1 ]
		q = arr [ i ]
		r = arr [ i + 1 ]
		if ( p < q and q > r ) :
			print ( i - 1 , i , i + 1 )
			return
	print ( - 1 )
if __name__ == ' _ _ main _ _ ' :
	arr = [ 2 , 1 , 4 , 3 ]
	N = len ( arr )
	FindTrip ( arr , N )