3098. Find the Sum of Subsequence Powers
You are given an integer array
nums
of lengthn
, and a positive integerk
.The power of a subsequence is defined as the minimum absolute difference between any two elements in the subsequence.
Return the sum of powers of all subsequences of
nums
which have length equal to\k
.Since the answer may be large, return it modulo
109 + 7
.
c++
1 |
|