31 Mon

๋ชจ์˜๊ณ ์‚ฌ

'''
https://programmers.co.kr/learn/courses/30/lessons/42840#
๋ชจ์˜๊ณ ์‚ฌ
[ํ’€์ด]
0. ๊ฐ์ž์˜ ๋น„๋ฒ•์„ ์‹ค์ œ ๋ฌธ์ œ์™€ ๋น„๊ต True ๊ฐœ์ˆ˜๋ฅผ ๋น„๊ตํ•˜์—ฌ ์ถœ๋ ฅ
'''
def solution(answers):
    size = len(answers)
    score = lambda x, y : x == y
    one = list(map(score, answers, [1,2,3,4,5]*(size // 5 + 1))).count(True)
    two = list(map(score, answers, [2,1,2,3,2,4,2,5]*(size // 8+ 1))).count(True)
    thr = list(map(score, answers, [3,3,1,1,2,2,4,4,5,5]*(size // 10 + 1))).count(True)
    answers = [one, two, thr]
    return [i+1 for i in range(3) if answers[i] == max(one, two, thr)]
'''
'''

Last updated

Was this helpful?