Practice Find the Sum of the Power of All Subsequences
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given an integer array nums of length n and a positive integer k. The power of an array of integers is defined as the number of subsequences with their sum equal to k. Return the sum of power of all subsequences of nums. Since the answer may be very large, return it modulo 10^9 + 7.
Source: Find the Sum of the Power of All Subsequences on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [1,2,3], k = 3
6
# Example 2
nums = [2,3,3], k = 5
4
# Example 3
nums = [1,2,3], k = 7
0
Constraints
Related LeetCode Problems
Practice more problems similar to Find the Sum of the Power of All Subsequences.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.