solve(nums) — nums holds distinct values. Return all subsets (the power set) as
an array of arrays, generated with a bitmask instead of recursion.
A set of n elements has 2^n subsets, and the numbers 0 .. 2^n - 1 written in
binary describe each one: bit i of the mask says whether nums[i] is in the subset.
The order is pinned so the result is deterministic: subsets come in increasing
mask order, and the elements of a subset keep their order from nums.
Examples
solve([1,2,3]) → [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
solve([5,7]) → [[],[5],[7],[5,7]]
solve([]) → [[]]Sample tests