Farz0l1x

Untitled

Mar 21st, 2023
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. from itertools import product
  2. count = 0
  3. for x in product('ДЕЙКСТРА', repeat = 6):
  4.     s = ''.join(x)
  5.     if s.count('Й') == 1 and s[-1] != 'Й':
  6.         i = s.find('Й')
  7.         if s[i + 1] == 'Д' or s[i + 1] == 'К' or s[i + 1] == 'С' or s[i + 1] == 'Т' or s[i + 1] == 'Р':
  8.             count += 1
  9. print(count)
Advertisement
Add Comment
Please, Sign In to add comment