Question
Total Subsets With Sum K
You are given an array of KaTeX can only parse string typed expression integers and an integer KaTeX can only parse string typed expression. Your task is to count the number of subsets whose sum is exactly equal to KaTeX can only parse string typed expression.
A subset can contain any number of elements from the array, including the empty subset.
Input
The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression — the size of the array and the required sum.
The second line contains KaTeX can only parse string typed expression integers representing the array elements — KaTeX can only parse string typed expression.
The second line contains KaTeX can only parse string typed expression integers representing the array elements — KaTeX can only parse string typed expression.
Output
Print a single integer — the number of subsets whose sum is exactly equal to KaTeX can only parse string typed expression.
Example
Input
4 5
1 2 3 4
Output
2
Explanation:
The subsets having sum equal to KaTeX can only parse string typed expression are:
KaTeX can only parse string typed expression
KaTeX can only parse string typed expression
So, the answer is KaTeX can only parse string typed expression.
4 5
1 2 3 4
Output
2
Explanation:
The subsets having sum equal to KaTeX can only parse string typed expression are:
KaTeX can only parse string typed expression
KaTeX can only parse string typed expression
So, the answer is KaTeX can only parse string typed expression.