Example 1
- Input
- nums = [1, 2, 3]
- Output
- [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3]]
Each of the three positions is either included or excluded, producing distinct subsets. The empty subset excludes everything, and [1, 2, 3] includes everything. The displayed order is one valid order; backtracking returns the same subsets in a different order.