문제링크: 모의고사
✍🏻 Information
| content | |
|---|---|
| 언어 | python |
| 난이도 | ⭐️ |
| 풀이시간 | 10분 |
| 제출횟수 | 1 |
| 인터넷검색유무 | no |
🍒 My Code
def solution(answers):
winner = []
score = [0 for i in range(3)]
pattern = [[1,2,3,4,5],[2,1,2,3,2,4,2,5],[3,3,1,1,2,2,4,4,5,5]]
for i in range(len(answers)):
for j in range(len(pattern)):
length = len(pattern[j])
if answers[i]==pattern[j][i%length]:
score[j]+=1
for i in range(len(score)):
if score[i]==max(score):
winner.append(i+1)
return winner
💡 What I learned