Count Positive - Negative Pairs
arr[i] = -arr[j] and i != j
Given array/list can contain duplicate elements and will not contain '0'. (arr[i],arr[j]) and (arr[j],arr[i]) are considered same.
The first line of each test case contains an integers 'N' where 'N' denotes the size of array/list(ARR). The next line contains 'N' space-separated integers representing array elements.
Print the total number of positive-negative pairs present in the array/list.
You are not required to print the output explicitly, it has already been taken care of. Just implement the function.
1 <= N <= 10^5 -10^9 <= arr[i] <= 10^9 Time Limit: 1 sec
Merge Two Sorted Arrays Without Extra Space
Ninja And The Strictly Increasing Array
Negative To The End
Sort 0s, 1s, 2s