algorithms.tutorialhorizon.com

Given an array, print all unique subsets with a given sum. | Algorithms

Given an array of integers and number N, Write an algorithm to find and print all the subsets of array for which sum is equal to N. Example: int [] arrA = {6,2,7,8,2,4,1,3,7,5}; Sum = 8 Output: [1, 2, 2, 3] [1, 2, 5] [1, 3, 4] [1, 7] [2, 2, 4] [2, 6] [3, 5] [8]