summaryrefslogtreecommitdiff
path: root/progs/a507.py
blob: ac38919f00f77a0f60a4c4a6e9e7ceee6bd8f4d6 (plain)
1
2
3
4
5
def sum_Pairs(arr,n): 
    sum = 0
    for i in range(n - 1,-1,-1): 
        sum += i*arr[i] - (n-1-i) * arr[i] 
    return sum