Farz0l1x

Untitled

Feb 24th, 2024
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. from itertools import *
  2. count = 0
  3. for elem in product("ПРОСТО", repeat = 6):
  4.     if elem.count("П") == 1 and elem.count("Р") == 1 and elem.count("О") == 2 and elem.count("С") == 1 and elem.count("Т") == 1:
  5.         pov = 0
  6.         for i in range(1, len(elem)):
  7.             if elem[i] == elem[i-1]:
  8.                 pov += 1
  9.         if pov == 0:
  10.             count += 1
  11. print(count)
Advertisement
Add Comment
Please, Sign In to add comment