Basically f(x) is summation of power K of absolute value of difference of every pair of array.In this question n(number of element in array),k,and element will be given and i have to fine first absolute difference between every pair of array and raise its power k, then add all them and find the answer%pow(10,9)+7
What I have tried:
I tried this problem by using 3 loops , one for power. because value of k can be go till 100000,and element of array can be go till 10^9