Take/ no take using memoization
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\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n\n    int mod = 1e9 + 7;\n    int d[101][101][101];\n    long long binpow(long long a, long long b, long long m) {\n    a %= m;\n    long long res = 1;\n    while (b > 0) {\n        if (b & 1)\n            res = res * a % m;\n        a = a * a % m;\n        b >>= 1;\n    }\n    return res;\n    }\n    int solve(vector<int>& nums, int k, int i, int cnt){\n        if(k < 0)return 0;\n        if(k == 0){\n            int rem = nums.size() - cnt;\n            long long int x = binpow(2, rem, mod) % mod;\n            return x;\n        }\n        if(i == nums.size())return 0;\n        if(d[i][k][cnt] != -1)return d[i][k][cnt];\n        int a = solve(nums, k - nums[i], i + 1, cnt + 1);\n        int b = solve(nums, k, i + 1, cnt);\n        int r = (1ll * a + b) % mod;\n        return d[i][k][cnt] = r;\n    }\n    int sumOfPower(vector<int>& nums, int k) {\n        memset(d, -1, sizeof(d));\n        return solve(nums, k, 0, 0);\n    }\n};\n```
['Dynamic Programming', 'Memoization', 'C++']