Given an array A of N distinct and positive elements, the task is to find number of unordered pairs whose sum already exists in given array.
Expected Complexity : n^2
1 <= N <= 1000 1 <= A[i] <= 10^6 + 5
A : [ 3, 4, 2, 6 ,7]
The pairs following the conditions are : (2,4) = 6, (3,4) = 7
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.