class Solution:
# @param num, a list of integer
# @return a list of lists of integer
def subsetsWithDup(self, S):
res = [[]]
for e in sorted(S):
res = res+[l+[e] for l in res if l+[e] not in res]
return res
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment