Find the summation of the product of Array elements in range [L, R]
Given an array arr[] and two integers L and R. The task is to find the sum of the product of all the pairs (i, j) in the range [L, R], such that i ⤠j. Input: arr[] = { 1, 3, 5, 8 }, L = 0, R = 2Output: 58Explanation: As 1*1 + 1*3 + 1*5 + 3*3 + 3*5 + 5*5 = 58 Input: arr[] = { 2, 1, 4, 5, 3, 2, 1 },