class Solution: # @param num, a list of integer # @return a list of lists of integers def permute(self, num): n=len(num) rst=[[]] for i in range(n): rst=[r+[elem] for r in rst for elem in num if elem not in r] return rst
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment