DP Memoization O(n*n*k) solution c++ beat 50%
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```\n#define ll long long\nconst int M=1e9+7;\nint mod(int x){\n    return ((x%M)+M)%M;\n}\nint addm(int x,int y){\n    return mod(mod(x)+mod(y));\n}\nll modex(ll a,ll b,ll m){\n    ll res = 1;\n    a = a % m;\n    while (b > 0) {\n        if (b&1) {\n            res = (res * a) % m;\n        }\n        b = b >> 1;\n        a = (a * a) % m;\n    }\n    return res;\n}\nclass Solution {\n    ll n;\n    ll dp[101][101][101];\n    ll solve(int ind,vector<int>&nums,int k,int count){\n        if(k==0){\n            return (modex(2,n-count,M));\n            return 1;\n        }\n        if(k<0||ind==n)return 0;\n        if(dp[ind][k][count]!=-1)return dp[ind][k][count];\n        int x=solve(ind+1,nums,k-nums[ind],count+1);\n        int y=solve(ind+1,nums,k,count);\n        return dp[ind][k][count]=addm(x,y);\n    }\npublic:\n    int sumOfPower(vector<int>& nums, int k) {\n        memset(dp,-1,sizeof(dp));\n        n=nums.size();\n        return solve(0,nums,k,0);\n    }\n};\n```
['Memoization', 'C++']