[Python] Easy to understand
Just calculate how many times a given subsequence of sum equal to k can occur in all the subsequences\n\n# Code\n\nclass Solution:\n    def sumOfPower(self, num
Just calculate how many times a given subsequence of sum equal to k can occur in all the subsequences\n\n# Code\n```\nclass Solution:\n    def sumOfPower(self, nums: List[int], k: int) -> int:\n\n        @cache\n        def solve(i,cs,count):\n            if cs==k: return 2**(len(nums)-count)\n            if i>=len(nums) or cs>k: return 0\n            take=solve(i+1,cs+nums[i],count+1)\n            nottake=solve(i+1,cs,count)\n            return take+nottake\n        return solve(0,0,0)%(10**9+7)\n        \n```
['Python3']