human
Two Pointers Technique | Naive solution to find if there is a pair in A [ 0. . N - 1 ] with given sum ..
as equal i and j means same element.
pair exists.
as the array is sorted.
No pair found with given sum.
Driver code.
Function call"
Solution in Python:
 Give me a code to two Pointers Technique and the other steps required?
assistant
#Here is code to two Pointers Technique and the other steps required.
 def isPairSum ( A , N , X ) :
	for i in range ( N ) :
		for j in range ( N ) :
			if ( i == j ) :
				continue
			if ( A [ i ] + A [ j ] == X ) :
				return True
			if ( A [ i ] + A [ j ] > X ) :
				break
	return 0
arr = [ 3 , 5 , 9 , 2 , 8 , 10 , 11 ]
val = 17
print ( isPairSum ( arr , len ( arr ) , val ) )