COMBINATORIAL JAVA APPROACH 
IntuitionSum of Power of Subsequences with sum = kUnderstand with an example ,
k= 3 nums = [1,2,3] 
Get any subseque let [1,2] sum = k , remaining = n-2 = 1
the
# Intuition
Sum of Power of Subsequences with sum = k 

Understand with an example , 
`k= 3` `nums = [1,2,3] `
Get any subseque let `[1,2]` `sum = k` , `remaining = n-2 = 1`
then `2Choices`  :` Include remaining` elements
            or  : `Exclude remaining` elements
since it true with all subsequence of nums either to include remaining elements or exclude 
hence 

`For all` valid subsequence of` sum = k` ,of `length len `
Cnt of subsequences = `2^(n-len)` (include+exclude)

and get all valid subsequences and get the sum of Power of valid subsequences .

# Approach
Do take care of exponent function limits , to not to exceed Integer.limit
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(n*k*n) -> dp ,  O(logn) -> Binary expo (for all valid subsequences) -> 
-` O(n^2 *k*logn)`
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(n*n*k) dp table
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    private final int mod = (int) 1e9 + 7;
    private int n;
    private Long[][][] dp;

    private long expo(int base, int exp) {
        long res = 1L;
        while (exp > 0) {
            if ((exp & 1) != 0) {
                res = (res * base) % mod;
            }
            base = (int)((1L * base * base) % mod);
            exp >>= 1;
        }
        return res;
    }

    public int sumOfPower(int[] nums, int k) {
        n = nums.length;
        dp = new Long[101][101][101];

        return (int) (helper(0, 0, 0, nums, k) % mod);
    }

    private long helper(int i, int sum, int len, int[] nums, int k) {
        if (sum == k) return expo(2, n - len);
        if (sum > k || i == n) return 0L;
        if (dp[i][len][sum] != null) return dp[i][len][sum];

        long s1 = helper(i + 1, (sum + nums[i]) % mod, len + 1, nums, k);
        long s2 = helper(i + 1, sum, len, nums, k);

        dp[i][len][sum] = (s1 % mod + s2 % mod) % mod;

        return dp[i][len][sum]; // Removed redundant modulo
    }
}
```
['Java']