23/12/07
프로그래머스 모의고사 문제 def solution(answers): answer = [] a = [1, 2, 3, 4, 5] b = [2, 1, 2, 3, 2, 4, 2, 5] c = [3, 3, 1, 1, 2, 2, 4, 4, 5, 5] count=[0,0,0] for idx,value in enumerate(answers): if a[idx % len(a)] == value: count[0]+=1 if b[idx % len(b)] == value: count[1]+=1 if c[idx % len(c)] == value: count[2]+=1 rank_max= max(count) for idx,value in enumerate(count): if value == rank_max: answer.appen..
2023. 12. 7.