Advertisement
Farz0l1x

Untitled

Apr 17th, 2024
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. for n in range(1, 1000):
  2.     s = '3' * 15 + '2' * 18 + '1' * n
  3.     while '31' in s or '33' in s or '21' in s:
  4.         if '31' in s:
  5.             s = s.replace('31', '123', 1)
  6.         if '33' in s:
  7.             s = s.replace('33', '211', 1)
  8.         if '21' in s:
  9.             s = s.replace('21', '1', 1)
  10.     if len(s) > 24:
  11.         print(n)
  12.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement