human
What is a code to pair having all other given pairs lying between its minimum and maximum and the other steps required given the following:
Pair having all other given pairs lying between its minimum and maximum | Function to find the position of the pair that covers every pair in the array arr.
Stores the index of the resultant pair.
To count the occurences.
Iterate to check every pair.
Set count to 0.
Condition to checked for overlapping of pairs.
If that pair can cover all other pairs then store its position.
If position not found.
Otherwise.
Driver Code.
Given array of pairs.
Function Call"
Solution in Python:
assistant
#Here is code to pair having all other given pairs lying between its minimum and maximum and the other steps required.
 def position ( arr , N ) :
	pos = - 1 ;
	count = 0 ;
	for i in range ( N ) :
		count = 0 ;
		for j in range ( N ) :
			if ( arr [ i ] [ 0 ] <= arr [ j ] [ 0 ] and arr [ i ] [ 1 ] >= arr [ j ] [ 1 ] ) :
				count += 1 ;
		if ( count == N ) :
			pos = i ;
	if ( pos == - 1 ) :
		print ( pos ) ;
	else :
		print ( pos + 1 ) ;
if __name__ == ' _ _ main _ _ ' :
	arr = [ [ 3 , 3 ] , [ 1 , 3 ] , [ 2 , 2 ] , [ 2 , 3 ] , [ 1 , 2 ] ] ;
	N = len ( arr ) ;
	position ( arr , N ) ;