Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ans = 0
- otv = 0
- alph = list(set("qwertyuiopasdfghjklzxcvbnm"))
- alph.sort()
- isin = set()
- s = input()
- def pereb(sps):
- global ans
- global otv
- global isin
- global s
- global alph
- if len(sps) == len(s):
- if "".join(sps) not in isin:
- if "".join(sps) == s:
- ans += 1
- otv = ans
- isin.add("".join(sps))
- print("#")
- else:
- ans += 1
- isin.add("".join(sps))
- print("##")
- else:
- for i in alph:
- sps.append(i)
- ans += 1
- print("###")
- pereb(n, sps)
- sps.pop()
- pereb([])
- print(otv)
Add Comment
Please, Sign In to add comment