## Perfect Sum Problem (Print all subsets with given sum)

Given an array of integers and a sum, the task is to print all subsets of given array with sum equal to given sum. Examples:… Read More »

- Subset array sum by generating all the subsets
- Recursive program to print all subsets with given sum
- Printing all subsets of {1,2,3,...n} without using array or loop
- Find all distinct subset (or subsequence) sums of an array | Set-2
- Maximize the difference between two subsets of a set with negatives
- Subset Sum Queries in a Range using Bitset
- Total number of subsets in which the product of the elements is even
- Minimum number of palindromes required to express N as a sum | Set 1
- Count sub-sets that satisfy the given condition
- Check whether bitwise AND of a number with any subset of an array is zero or not
- Check if it is possible to get back to 12'0 clock only by adding or subtracting given seconds
- Weird Number
- Count no. of ordered subsets having a particular XOR value
- Find if there is any subset of size K with 0 sum in an array of -1 and +1
- Largest subset where absolute difference of any two element is a power of 2
- Sum of sum of all subsets of a set formed by first N natural numbers
- Semiperfect Number

Given an array of integers and a sum, the task is to print all subsets of given array with sum equal to given sum. Examples:… Read More »

Given an array of integer values, we need to find the minimum difference between maximum and minimum of all possible K-length subsets. Examples : Input… Read More »

Given an array the task is to largest divisible subset in array. A subset is called divisible if for every pair (x, y) in subset,… Read More »

Given a set of integers, find distinct sum that can be generated from the subsets of the given sets and print them in an increasing… Read More »

Given an array arr[] and a number of queries, where in each query we have to check whether a subset whose sum is equal to… Read More »

Given an array of n integers where each value represents number of chocolates in a packet. Each packet can have variable number of chocolates. There… Read More »

Given an array of distinct positive numbers, the task is to calculate the number of subsets (or subsequences) from the array such that each subset… Read More »

Given an array arr of N integer elements, the task is to find sum of average of all subsets of this array. Example : Input… Read More »

Given an array arr[] of n numbers and a number K, find the number of subsets of arr[] having XOR of elements as K Examples:… Read More »

Given a set of n elements, find number of ways of partitioning it. Examples: Input: n = 2 Output: Number of ways = 2 Explanation:… Read More »

Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given… Read More »

Partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets is… Read More »

Subset sum problem is to find subset of elements that are selected from a given set whose sum adds up to a given number K. We… Read More »