```
import math
class Solution(object):
def helper(self,res,nums,i):
tmp=[]
for j in range(len(nums)):
if i&1:
tmp.append(nums[j])
i>>=1
res.append(tmp)
def subsets(self,nums):
if not nums:
return [[]]
res,state=[],int(math.pow(2,len(nums)))
for i in range(state):
self.helper(res,nums,i)
return res
```