human
Find any two pairs ( a , b ) and ( c , d ) such that a d | Function to find two pairs ( a , b ) and ( c , d ) such that a < c and b > d.
Sort the array in increasing order of first element of pairs.
Traverse the array.
If no such pair found.
Driver Code"
Solution in Python:
assistant
#Here is code to find any two pairs ( a , b ) and ( c , d ) such that a d and the other steps required.
 def findPair ( arr , N ) :
	arr . sort ( key = lambda x : x [ 0 ] )
	for i in range ( 1 , N ) :
		b = arr [ i - 1 ] [ 1 ]
		d = arr [ i ] [ 1 ]
		if ( b > d ) :
			print ( " ( " , arr [ i - 1 ] [ 0 ] , b , " ) , ▁ ( " , arr [ i ] [ 0 ] , d , " ) " )
			return
	print ( " NO SUCH PAIR EXIST " ) ;
arr = [ [ 3 , 7 ] , [ 21 , 23 ] , [ 4 , 13 ] , [ 1 , 2 ] , [ 7 , - 1 ] ]
findPair ( arr , 5 )