algorithm/python
프로그래머스/완전탐색/모의고사
아르르르를를르
2020. 3. 8. 15:07
https://programmers.co.kr/learn/courses/30/lessons/42840
오.. 노가다로 풀었다.
level1
def solution(answers):
answer = []
n = [0,0,0]
num1 = [1,2,3,4,5] * 2000
num2 = [2,1,2,3,2,4,2,5] * 1250
num3 = [3,3,1,1,2,2,4,4,5,5] * 1000
for i in range(len(answers)):
ans = answers[i]
if ans == num1[i]: n[0] +=1
if ans == num2[i]: n[1] +=1
if ans == num3[i]: n[2] +=1
big = sorted(n)[-1]
for i in range(len(n)):
if n[i] == big:
answer.append(i+1)
return answer