For this Question: Given an unsorted integer array having distinct integers, find a pair with the given sum in it.
First element of pair > second element of pairFirst line of input contains a single integer N, next line contains N space separated integers depicting the values of array and third line consist target sum.

Constraints:
2<=N<=5*(10^5)
1<=A[i], target<=2*(10^9)
TargetPrint the pair of integers which sum is target.
Sample Input1:-
6
8 7 4 5 3 1
10

Sample Output:-
Pair found (7, 3)


Sample Input2:
 6
5 2 6 8 1 9
12
 
Sample Output:
Pair not found, I have written this Solution Code: 
N=int(input())
arr=list(map(int,input().split()))
target=int(input())

arr.sort(reverse=True)
'''
ans='Pair not found'
for i in range(N):
    for j in range(i+1,N):
        if arr[i]+arr[j]==target:
            ans='Pair found ({}, {})'.format(arr[i],arr[j])

print(ans)
'''


i=0
j=N-1
ans='Pair not found'

while i<j:
    if arr[i]+arr[j]<target:
        j-=1
    elif arr[i]+arr[j]>target:
        i+=1
        j+=1
    else:
        ans='Pair found ({}, {})'.format(arr[i],arr[j])
        break

print(ans), In this Programming Language: Python, Now tell me if this Code is compilable or not?