Guest User

Untitled

a guest
Dec 14th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def solution(A):
  2. numcouunt = []
  3. count = []
  4. for num in set(A):
  5. numcount.append(A.count(num))
  6. count.append(num)
  7. if numcount:
  8. if max(numcount) > len(A) / 2:
  9. num = count[numcount.index(max(numcount))]
  10. return A.index(num)
  11. return -1
Add Comment
Please, Sign In to add comment