You are given an integer array nums of unique elements.
Your task is to generate the superset of nums — that is, return all possible subsets (the power set) of nums.
You may assume that:
nums are unique.Return a list of all possible subsets. The order of the result and the order of elements within each subset do not matter.
[0]
[ [], [0] ]
The superset of a single-element set contains the empty set and the set itself.
[0, 1]
[ [], [0], [1], [0, 1] ]
For two elements there are four possible subsets: the empty set, each singleton, and the full set.
[0, 1, 2]
[ [], [0], [1], [2], [0, 1], [0, 2], [1, 2], [0, 1, 2] ]
For three elements there are 2^3 = 8 possible subsets.
[0]
[ [], [0] ]