Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #24 https://kpolyakov.spb.ru/school/ege/gen.php?action=viewVar&select=7FFFFFF&answers=on&varId=91034
- s = open('24.txt').readline()
- alph = '1234567890ABCDEF'
- c = ''
- answ = 0
- for e in s:
- if e not in alph:
- if len(c) != 0:
- if '0' in c:
- lst0 = c.rindex('0')
- c = c[:lst0 + 1]
- while len(c) > 0 and c[0] == '0':
- c = c[1:]
- answ = max(answ, len(c))
- c = ''
- else:
- c += e
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement