Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('24.txt') as f:
- a = f.readline()
- a = list(map(lambda a: a[1], sorted(list(filter(lambda x: x[0] == 'A', zip(a, a[1:]))))))
- def f(a, b):
- if a == b:
- return a
- if a != b:
- return a + ' '
- symb = list(map(f, a, a[1:]))
- symb = (''.join(symb) + a[-1]).split()
- symlen = list(map(len, symb))
- print(symb[symlen.index(max(symlen))][0])
Advertisement
Add Comment
Please, Sign In to add comment