dxnge

task 19

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