Find how many subsets are possible with a given sum in a set
Answers
Answered by
4
Heya....
Here you go ⬇️⬇️
Consider we have a set of n numbers, and we want to calculate the number of subsets in which the addition of all elements equal to x.
Input first line has n, x and the next line contains n numbers of our set. In the output we have to calculate the number of subsets that have total sum of elements equal to x.
INPUT 4 3 -1 2 4 2
OUTPUT 2
Hope it helps
Here you go ⬇️⬇️
Consider we have a set of n numbers, and we want to calculate the number of subsets in which the addition of all elements equal to x.
Input first line has n, x and the next line contains n numbers of our set. In the output we have to calculate the number of subsets that have total sum of elements equal to x.
INPUT 4 3 -1 2 4 2
OUTPUT 2
Hope it helps
Similar questions
Hindi,
7 months ago
English,
7 months ago
Computer Science,
7 months ago
Sociology,
1 year ago
Chemistry,
1 year ago