Advertisement
Bad_Programist

Untitled

Nov 28th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. a = input()
  2. b = a.split(' ')
  3. c = []
  4. m = 0
  5. for i in range(1, len(b)):
  6.     m = max(b.count(b[i]), b.count(b[i - 1]))
  7. for i in b:
  8.     if b.count(i) == m and c.count(i) == 0:
  9.         c.append(int(i))
  10. if len(b) != 1:
  11.     res = max(c)
  12. else: res = int(a)
  13. print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement