Problem
Return all possible subsets of the input array.
Example 1
Input: nums = [1,2,3]
Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
Constraints
- 1 <= nums.length <= 10
Notes
- Focus on the underlying backtracking pattern.
- Write the cleanest correct solution before optimizing further.
- Hidden tests cover larger edge cases than the visible examples.