Subset Sum Problem
Medium

Problem Statement

Determine if there exists a subset of given set with sum equal to given sum.

Examples

1Example 1
Input:
{ "set": [ 3, 34, 4, 12, 5, 2 ], "sum": 9 }
Output:
true
2Example 2
Input:
{ "set": [ 3, 34, 4, 12, 5, 2 ], "sum": 30 }
Output:
false
3Example 3
Input:
{ "set": [ 1, 2, 3, 7 ], "sum": 6 }
Output:
true
Loading...

Sign in to Run Code and Submit