':type nums: List[int]
:rtype: List[List[int]]'

def subsets(self, nums):

    nums.sort()
    result = [[]]
    for i in xrange(len(nums)):
        size = len(result)
        for j in xrange(size):
            result.append(list(result[j]))
            result[(-1)].append(nums[i])
    return result
