[Programmers/Level 1] 모의고사

2020. 6. 14. 19:21코딩테스트 준비/Programmers

https://programmers.co.kr/learn/courses/30/lessons/42840

def solution(answers):
    point = [0,0,0]
    ans = [[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 n in range(len(ans)):
            if(answers[i] == ans[n][i%len(ans[n])]): point[n] += 1

    return [ i+1 for i in range(len(point)) if point[i]==max(point)]

채점 결과

정확성: 100.0

합계: 100.0 / 100.0

 

ㅎㅎ내가 제일 숏코딩이다 아싸ㅣ