#3098

Find the Sum of Subsequence Powers

international master · 2100 · lc hard +32 · 25.1% accepted · 148 likes · top 4%

Description

Given an integer array nums and positive integer k, the power of a length-k subsequence is the minimum absolute difference between any two of its elements. Return the sum of powers across all length-k subsequences of nums, modulo 109 + 7.

Code

1
2
3