Generate All Subsets

Return all possible subsets (the power set) of a given array of distinct integers. The result must not contain any duplicate subsets. Subsets can be returned in any order.

Examples
Input: [1,2,3]
Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
Hints

Generate All Subsets

Return all possible subsets (the power set) of a given array of distinct integers. The result must not contain any duplicate subsets. Subsets can be returned in any order.