def solution(answers):
num1 = [1,2,3,4,5]
num2 = [2,1,2,3,2,4,2,5]
num3 = [3,3,1,1,2,2,4,4,5,5]
cnt = [0,0,0]
answer = []
for i in range(len(answers)):
if num1[i%5] == answers[i]:
cnt[0] += 1
if num2[i%8] == answers[i]:
cnt[1] += 1
if num3[i%10] == answers[i]:
cnt[2] += 1
max_num = max(cnt)
if cnt[0] == max_num:
answer.append(1)
if cnt[1] == max_num:
answer.append(2)
if cnt[2] == max_num:
answer.append(3)
answer.sort()
return answer
댓글 영역