Pascal’s Triangle

In mathematics, Pascal’s triangle is a triangular array of the binomial coefficients. It can also be viewed as: each number in Pascal’s triangle is the sum of the two numbers directly above it as shown: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 […]

Subset with a given sum and number of subsets

Problem Statement You are given an array of non-negative integers, you have to find if there’s a subset of this array having sum equal to the given sum. Subset needs not to be contiguous. Example:  Input: arr[] = {3, 34, 4, 12, 5, 2}, sum = 8 Output: True Subset (3, […]