C++ 2D DP
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  $$O(n*n)$$\n\n- Space complexity:\n$$O(n*k)$$ \n\n# Code\n```\n#define ll long long int\nclass Solution {\npublic:\n    vector<vector<ll>>dp;\n    ll mod=pow(10,9)+7;\n    ll aman(ll st,ll en,vector<int>&nums,ll k){\n        if(st==en){\n            if(k){\n                return 0;\n            }\n            return 1;\n        }\n        if(k<0){\n            return 0;\n        }\n        if(dp[st][k] != -1){\n            return dp[st][k];\n        }\n        ll ans=0;\n        // put element in to power set and use it reduce value of k\n        ans+=aman(st+1,en,nums,k-nums[st])%mod;\n        // put element in power set and not use it to reduce value of k\n        ans+=aman(st+1,en,nums,k)%mod;\n        // not include in power set\n        ans+=aman(st+1,en,nums,k)%mod;\n        return dp[st][k] = ans%mod;\n    }\n    int sumOfPower(vector<int>& nums, int k) {\n        ll n=nums.size();\n        dp.clear();\n        dp.resize(n,vector<ll>(k+1,-1));\n        return aman(0,n,nums,k);\n    }\n};\n```
['Dynamic Programming', 'C++']