Given an integer N and an array of N integers. Calculate the sum of products of all pairs of integers of the array.
Note: Since the answer can be large, return the answer modulo 109+7.
So, the answer is 11.
So, the answer is 16.
You don't need to read input or print anything. Your task is to complete the function productOfPairs() which takes the integer N and array A as input parameters and returns the sum of the product of all pairs of integers from the array.
Expected Time Complexity:O(N) Expected Auxillary Space:O(1)