Search
⌘K

Leetcode 3082. Find the Sum of the Power of All Subsequences

Compute the total "power" defined as the sum, over all subsequences S of nums, of how many sub-subsequences of S have sum equal to k — which is equivalent to summing 2^(n-|A|) over all subsets A whose sum is k. The algorithmic challenge is to count subsets by sum and size efficiently (n ≤ 100, k ≤ 100) and compute the weighted total modulo 1e9+7.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.