Count of Subsets with a Given Sum
Medium

Problem Statement

Count number of subsets in a set which sum to a given sum.

Examples

1Example 1
Input:
{ "nums": [ 2, 3, 5, 6, 8, 10 ], "sum": 10 }
Output:
3
2Example 2
Input:
{ "nums": [ 1, 2, 3, 3 ], "sum": 6 }
Output:
3
3Example 3
Input:
{ "nums": [ 10, 20, 15 ], "sum": 30 }
Output:
1
Loading...

Sign in to Run Code and Submit