Given an array of distinct integers, generate every subset (the power set) using bitmask enumeration. Return the subsets ordered by their bitmask value from 0 to 2^n - 1, and within each subset keep the elements in their original array order. The empty subset comes first.
Input: A JSON object {"nums": [<distinct integers>]}.
Output: Return a list of subsets ordered by increasing bitmask value.
Input: {"nums":[1,2]}
Output: [[],[1],[2],[1,2]]
Explanation: Masks 00,01,10,11 give [], [1], [2], [1,2].Input: {"nums":[7]}
Output: [[],[7]]
Explanation: Masks 0 and 1 give the empty subset and [7].0 <= len(nums) <= 15elements are distinct