daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Dec 14th, 2018 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top