[프로그래머스] 모의고사
내 코드 def solution(answers): s1, s2, s3 = 0,0,0 n = len(answers) c = n//40+1 a1 = [1,2,3,4,5]*(8*c) a2 = [2,1,2,3,2,4,2,5]*(5*c) a3 = [3,3,1,1,2,2,4,4,5,5]*(4*c) for i in range(n): if answers[i] == a1[i]: s1 += 1 if answers[i] == a2[i]: s2 += 1 if answers[i] == a3[i]: s3 += 1 scores = [s1,s2,s3] m = max(scores) winners = [] for i in range(3): if scores[i] == m: winners.append(i+1) return winners ..
2021. 4. 25.