C++ || DP Solution
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    int dp[101][101][101];\n    int n,md=1e9+7;\n    int func(int x)\n   {\n       if(x==0) return 1;\n       return (func(x-1)*2)%md;\n   }\n    int tp(int k,int i,int cnt,vector<int> &nums){ \n        if(k==0){\n            return func(nums.size()-cnt);\n        }\n        if(k<0 or i==nums.size()) return 0;\n        if(dp[k][i][cnt]!=-1) return dp[k][i][cnt];\n        int ans; \n        return dp[k][i][cnt]=(tp(k-nums[i],i+1,cnt+1,nums)+tp(k,i+1,cnt,nums))%md;\n    }\n    int sumOfPower(vector<int>& nums, int k) {\n    n=nums.size();\n    memset(dp, -1, sizeof(dp));  \n    return  tp(k,0,0,nums)%md; \n    }\n};\n```
['C++']