[ 프로그래머스 ] 2016년
/ 제출 1 / def solution(a, b): # 윤년: 2월이 29일까지인 해 +1일 # 한 달 날짜 수:31일: 1,3,5,7,8,10,12 +3일 | 30일: 4,6,9,11 +2일 thirty_one = [1,3,5,7,8,10,12] thirty = [4,6,9,11] # 1월 1일 금 +28(+3일) 2월 화+28(+1일) 3월 수 # 3,1,3,2 = 9일/7일 = 2일 => 5월은 일부터 시작(0) + 24/7 = 3 (-1) 화 # 5월 24일 화 day = ['SUN','MON','TUE','WED','THU','FRI','SAT'] passing_date = 0 num = 0 for i in range(a-1): if i+1 in thirty_one: num = 3 elif i+..
[ 프로그래머스 ] 모의고사
/ 제출 1 / def solution(answers): result = [] n = len(answers) first = [1,2,3,4,5] second = [2,1,2,3,2,4,2,5] third = [3,3,1,1,2,2,4,4,5,5] students = [first, second, third] for student in students: score = 0 # answer이 학생찍는 기본배열보다 작을 때 if n < len(student): for a, s in zip(answers, student[:n]): if a == s: score += 1 # 학생 찍는 기본 배열보다 answer이 많을 때 else: # 기본 배열 늘려주기 student = student*(n//len(student)..