Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import itertools
- x = list(itertools.permutations("НИЧЬЯ"))
- ans = []
- for i in range(len(x)):
- if x[i][0] =='Ь':
- continue
- s = "".join(x[i])
- if s.count("ЬИЯ")>0:
- continue
- ans.append(x[i])
- print(len(ans))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement