Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = ''
- for i in range(85):
- s += '1'
- k = 0
- while s.count('11111') > 0:
- #s = s.replace('111', '2')
- #s = s.replace('222', '1')
- l = len(s)
- for i in range(l - 3):
- if s[i:i+3] == '111':
- s = s[:i] + '2' + s[i+3::]
- break
- l -= 2
- for i in range(l - 3):
- if s[i:i+3] == '222':
- s = s[:i] + '1' + s[i+3::]
- break
- #print(s)
- #print()
- #k += 1
- #if k > 10:
- #break
- print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement