C++ || DP || Easy 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], M = 1e9 + 7;\n    int power(long long x, int y, int p) {\n        int res = 1;\n        x = x % p; \n        while (y > 0) {\n            if (y % 2 == 1)\n                res = (res * x) % p;\n            y = y >> 1;\n            x = (x * x) % p;\n        }\n        return res;\n    }\n    int f(int ind, int n, vector<int>& a, int k, int cnt) {\n        if (k == 0) return power(2, n - cnt, M);\n        if (ind == n) return 0;\n        if (dp[ind][k][cnt] != -1) return dp[ind][k][cnt];\n        int notTake = f(ind + 1, n, a, k, cnt) % M;\n        int take = 0;\n        if (k >= a[ind]) {\n            take = f(ind + 1, n, a, k - a[ind], cnt + 1) % M;\n        }\n        return dp[ind][k][cnt] = (take % M + notTake % M) % M;\n    }\n    int sumOfPower(vector<int>& a, int k) {\n        int n = a.size();\n        memset(dp, -1, sizeof(dp));\n        return f(0, n, a, k, 0);\n    }\n};\n```
['C++']