Skip to content

DP Solution to Subset Count #3553

@samratpodder

Description

@samratpodder

Is your feature request related to a problem? Please describe.
Count Subsets is an extension to the Subset Sum problem. Given an array arr[] of length N and an integer X, the task is to find the number of subsets with a sum equal to X.

Describe the solution you'd like
A Dynamic Programming-based solution to the above problem and the original recursion-based solution.

Additional context
Testcase:
Input: arr[] = {1, 2, 3, 3}, X = 6
Output: 3
All the possible subsets are {1, 2, 3},
{1, 2, 3} and {3, 3}

Input: arr[] = {1, 1, 1, 1}, X = 1
Output: 4

@siriak I am working on this. Kindly, assign this issue to me @samratpodder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions