Skip to content

Instantly share code, notes, and snippets.

@gummibeatz
Created June 25, 2016 15:41
Show Gist options
  • Save gummibeatz/f2455ca670def88950a0bbf912455fd9 to your computer and use it in GitHub Desktop.
Save gummibeatz/f2455ca670def88950a0bbf912455fd9 to your computer and use it in GitHub Desktop.
def solution(num):
num_str = str(num)
solution_set = Set()
for subset in permutations(num_str, len(num_str)):
if subset[0] != '0' or len(subset) == 1:
solution_set.add(subset)
return len(solution_set)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment