Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file = open('17.txt')
- text = file.readline()
- d = dict
- Max = 0
- for i in range(len(text) - 2):
- if text[i - 2] == text[i]:
- for c in text:
- if c in d:
- d[c] += 1
- Max = max(Max, d[c])
- else:
- d[c] = 1
- ans = []
- for c in d:
- if d[c] == Max:
- ans.append(c)
- ans.sort()
- print(ans[0])
Advertisement
Add Comment
Please, Sign In to add comment