문제 링크
CODE
from math import ceil
def solution(answers):
answer = []
first = [1,2,3,4,5]*ceil(len(answers)/5)
second = [2,1,2,3,2,4,2,5]*ceil(len(answers)/8)
third = [3,3,1,1,2,2,4,4,5,5]*ceil(len(answers)/10)
f_cnt = 0
s_cnt = 0
t_cnt = 0
for i in range(len(answers)):
if answers[i] == first[i]:
f_cnt += 1
if answers[i] == second[i]:
s_cnt += 1
if answers[i] == third[i]:
t_cnt += 1
flag = max(f_cnt,s_cnt,t_cnt)
if f_cnt == flag:
answer.append(1)
if s_cnt == flag:
answer.append(2)
if t_cnt == flag:
answer.append(3)
return answer
from math import ceil
ceil(float)