Java Clean Solution Using DP + Tabulation
Complexity\n- Time complexity:O(nk)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(nk)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity:$$O(n*k)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n*k)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    int MOD = 1_000_000_007;\n\n    public int sumOfPower(int[] nums, int k) {\n        int n = nums.length;\n        int[][] dp = new int[n][k + 1];\n        dp[0][0] = 2;\n\n        if (nums[0] <= k)\n            dp[0][nums[0]] = 1;\n\n        for (int i = 1; i < n; i++) {\n            for (int j = 0; j <= k; j++) {\n                int temp = (dp[i - 1][j] << 1) % MOD;\n                dp[i][j] = (temp + (j < nums[i] ? 0 : dp[i - 1][j - nums[i]])) % MOD;\n            }\n        }\n        return dp[n - 1][k];\n    }\n}\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'Java']