Subsets
Given an integer array nums of **unique** elements, return all possible subsets (the power set).
The solution set must not contain duplicate subsets. Subsets — and the elements within each subset — may be returned in **any order**.
Example cases
- three elementsin nums = [1,2,3]out [[],[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]]All 2^3 = 8 subsets, including the empty set.
- singlein nums = [0]out [[],[0]]
- negativesin nums = [-1,2]out [[],[-1],[2],[-1,2]]
Constraints
- 1 <= nums.length <= 10
- -10 <= nums[i] <= 10
- All numbers are unique.
nums =
[1,2,3]