Advertisement
Apauldin

99

Nov 19th, 2021 (edited)
872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. import itertools
  2. x = list(itertools.permutations("НИЧЬЯ"))
  3. ans = []
  4. for i in range(len(x)):
  5.     if x[i][0] =='Ь':
  6.         continue
  7.     s = "".join(x[i])
  8.     if s.count("ЬИЯ")>0:
  9.         continue
  10.     ans.append(x[i])
  11. print(len(ans))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement