dxnge

18

Sep 27th, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. with open('24.txt') as f:
  2.     a = f.readline()
  3.     a = list(map(lambda a: a[1], sorted(list(filter(lambda x: x[0] == 'A', zip(a, a[1:]))))))
  4.  
  5.  
  6. def f(a, b):
  7.     if a == b:
  8.         return a
  9.     if a != b:
  10.         return a + ' '
  11.  
  12.  
  13. symb = list(map(f, a, a[1:]))
  14. symb = (''.join(symb) + a[-1]).split()
  15. symlen = list(map(len, symb))
  16. print(symb[symlen.index(max(symlen))][0])
Advertisement
Add Comment
Please, Sign In to add comment