Easy Java Solution || Dynamic Programming
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 {\n    static int dp[][][];\n    static int mod = (int) (1e9) + 7;\n\n    static int helper(int arr[], int idx, int currSum, int k, int size){\n        if(currSum==k){\n            return (int)(Math.pow(2,arr.length-size)%mod);\n        }\n        if(idx>=arr.length || currSum>k) return 0;\n        if(dp[idx][currSum][size]!=-1) return dp[idx][currSum][size];\n\n        int ans = (helper(arr,idx+1,currSum,k,size)%mod+helper(arr,idx+1,currSum+arr[idx],k,size+1))%mod;\n        return dp[idx][currSum][size] = ans;\n    }\n    public int sumOfPower(int[] arr, int k) {\n        dp = new int[105][105][105];\n        for(var a : dp) for(var b : a) Arrays.fill(b,-1);\n        return helper(arr,0,0,k,0);\n    }\n}\n```
['Java']