Best of solution , easy approach
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#include <vector>\n#include <cstring>\n\nusing namespace std;\n\nclass Solution {\npublic:\n    long long M = 1000000007;\n\n    long long power(long long a, long long b) {\n        long long res = 1;\n        while (b > 0) {\n            if (b % 2 == 0) {\n                a = (a * a) % M;\n                b /= 2;\n            } else {\n                res = (res * a) % M;\n                b -= 1;\n            }\n        }\n        return res % M;\n    }\n\n    int sumOfPower(vector<int>& nums, int k) {\n        int n = nums.size();\n        long long dp[101][101][101];\n        memset(dp, 0, sizeof(dp));\n\n        for (int idx = 1; idx <= n; idx++) {\n            if (nums[idx - 1] <= 100) dp[idx][1][nums[idx - 1]] += 1;\n            for (int len = 2; len <= idx; len++) {\n                for (int last = 1; last < idx; last++) {\n                    for (int sum = nums[idx - 1] + 1; sum <= k; sum++) {\n                        dp[idx][len][sum] += dp[last][len - 1][sum - nums[idx - 1]];\n                        dp[idx][len][sum] %= M;\n                    }\n                }\n            }\n        }\n\n        long long ans = 0;\n        for (int i = 1; i <= n; i++) {\n            for (int len = 1; len <= n; len++) {\n                long long count = dp[i][len][k];\n                count *= power(2, n - len);\n                count %= M;\n\n                ans += count;\n                ans %= M;\n            }\n        }\n        return ans;\n    }\n};\n\n```
['C++']