Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- results = set()
- def helper(slate, arr):
- if len(arr) ==0:
- results.add(tuple(slate))
- else:
- for i in range(len(arr)):
- helper(slate+[arr[i]] ,arr[:i]+arr[i+1:])
- return results
- def get_permutations(arr):
- helper([],arr)
- return list(results)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement