```
class Solution(object):
def subsetsWithDup(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
return reduce(lambda x,i: [ a+[i[0]]*j for j in range(i[1]+1) for a in x], collections.Counter(nums).items(), [[]])
```