프로그래머스 모의고사 파이썬
일단 이렇게 풀었다. 너무 난잡해 보여서 다른 사람들의 코드를 한 번 봐야지일단 이렇게 풀었다. 너무 난잡해 보여서 다른 사람들의 코드를 한 번 봐야지 def solution(answers): solve = [] one = 0 two = 0 three = 0 one_list = [1,2,3,4,5] two_list = [2,1,2,3,2,4,2,5] three_list = [3,3,1,1,2,2,4,4,5,5] for i in range(len(answers)): if answers[i] == one_list[i%5]: one += 1 if answers[i] == two_list[i%8]: two += 1 if answers[i] == three_list[i%10]: three += 1 sample =..
알고리즘 공부
2021. 3. 23. 22:33