Question

Write a function that generates all subsets of given set?

Login to Submit

Examples

Input: [1, 2, 3]
Output: [[1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3], []]
Reason: There are 8 subsets of the given set [1, 2, 3]