Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 434 Bytes

File metadata and controls

12 lines (9 loc) · 434 Bytes

Problem 13: The Subset Sum Finder (Subset Sum Problem)

Problem Statement

Given an array of non-negative integers and a target sum, determine if there exists a subset of the given array whose elements sum up to the target. Return all such subsets.

Input Format

  • An array of non-negative integers nums.
  • An integer target.

Example

Input: nums = [3, 34, 4, 12, 5, 2], target = 9
Output: [[4, 5], [3, 4, 2]]