#3082

Find the Sum of the Power of All Subsequences

master · 1760 · lc hard +32 · 38.1% accepted · 168 likes · top 17%

Description

Given an integer array nums of length n and a positive integer k, the power of an array is the number of its subsequences whose elements sum to k. Return the total power summed across all subsequences of nums, modulo 109 + 7.

Code

1
2
3