Advertisement
Apauldin

99

Nov 19th, 2021 (edited)
778
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement