[python] 모의고사
문제 출처 모의고사 풀이 def solution(answers): 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] score = [0, 0, 0] for idx, correct in enumerate(answers): if correct == a[idx%5]: score[0] += 1 if correct == b[idx%8]: score[1] += 1 if correct == c[idx%10]: score[2] += 1 answer = sorted([idx+1 for idx, s in enumerate(score) if s == max(score)]) return answer
2019. 8. 27.