πDay 14. Subset Sum Problem π§
π‘ Problem Description:
π Example Walkthrough:
Example 1:
Input:
arr[] = {3, 34, 4, 12, 5, 2}
sum = 9Output:
trueExplanation:
Example 2:
Input:
Output:
Explanation:
Example 3:
Input:
Output:
Explanation:
Constraints:
π― My Approach:
Dynamic Programming (Optimized 1D DP) β O(N Γ sum) Time, O(sum) Space
π Time and Auxiliary Space Complexity
π Solution Code
Code (C++)
Code (Java)
Code (Python)
π― Contribution and Support:
πVisitor Count
Last updated