similar to 01 Knapsack problem
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n(O)N*K\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n(O)N\n# Code\n```\n/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar sumOfPower = function (nums, k) {\n    const mod = Math.pow(10, 9) + 7\n    const n = nums.length\n    const memo = new Array(k + 1).fill(0)\n    memo[0] = 1\n    for (let i = 0; i < n; i++) {\n        for (let j = k; j >= 0; j--) {\n            memo[j] = (memo[j] * 2) % mod\n            if (nums[i] <= j) {\n                memo[j] += memo[j - nums[i]]\n            }\n        }\n    }\n    return memo[k]%mod\n};\n```
['JavaScript']