Given N integers. Let Total subsets T=2N. How many subsets are available from T where the distinct integers are less than or equal to K. Sample Input: 4 2 (N,K) 1 2 3 4(A[i]) Sample Output: 11 Sample Input: 4…

Given N integers. Let Total subsets T=2N. How many subsets are available from T where the distinct integers are less than or equal to K. Sample Input: 4 2 (N,K) 1 2 3 4(A[i]) Sample Output: 11 Sample Input: 4…

Posted in Dynamic Programming

You are given an array a[] of length N. You have to output P such that p=summation of some array elements. An condition must be hold that is if you choose the i-th element of the array, then you mustn’t…