Since, this is a function problem. You don't need to take any input, as it is already accomplished by the driver code. You just need to complete the function findPairs() that takes array a and n as parametersand return 1 if pair exists else 0.
Expected Time Complexity: O(N2). Expected Auxiliary Space: O(N2).