Skip to content

Add implementation to count number of subsets achieving maximum knapsack value #14463

@anikchand461

Description

@anikchand461

Feature description

The existing knapsack implementation computes only the maximum achievable value. This PR proposes adding a variation that also counts the number of distinct subsets that achieve this optimal value. The implementation will extend dynamic programming logic to track both value and count, and will include proper documentation, type hints, and doctests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis PR modified some existing files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions