https://programmers.co.kr/learn/courses/30/lessons/42840
def solution(answers):
answer = [0,0,0]
ans1 = [1,2,3,4,5]
ans2 = [2,1,2,3,2,4,2,5]
ans3 = [3,3,1,1,2,2,4,4,5,5]
for i,j in enumerate(answers):
if(j == ans1[i%5]):
answer[0] = answer[0]+1
if(j == ans2[i%8]):
answer[1] = answer[1]+1
if(j == ans3[i%10]):
answer[2] = answer[2]+1
maxi = answer[0]
ans = [1]
for i in range(1, 3):
temp= answer[i]
if(temp > maxi):
ans.clear()
ans.append(i+1)
maxi = temp
elif(temp == maxi):
ans.append(i+1)
return ans