There are two ways to write error-free programs; only the third one works.Alan J. Perlis

Detect duplicate in a subset from a set of elements.

If we give the number of elements as 2, we will get 2^2= 2 * 2 = 4 output subsets.

If we give the number of elements as 3, we will get 2^3= 2 * 2 * 2 = 8 output subsets.

Example:-

Input array :[1, 2]

Output subsets:[[2], [1, 2], [1], []].

Input array :[1, 2, 3] Output subsets:[[3], [2, 3], [2], [1, 3], [1, 2, 3], [1, 2], [1], []]

## Comments

Posted by gita.maganiApril 14, 2016 12:00 pm

Looks like the Source code is incorrect for this problem.

Please login to add comments.