All subsets
hardRecursion40 XP
nums has different numbers, sorted from small to large. Return all its subsets (including the empty one). Keep the numbers inside each subset in order. Any order of the subsets is accepted.
Examples
- Input: nums = [1, 2]Output: [[], [1], [2], [1, 2]]
- Input: nums = []Output: [[]]
Examples use JSON: true/false/null are True/False/None in Python. Any order of the answer's items is accepted.