개인정보 수집 유효기기간1 [프로그래머스] Lv 1. 개인정보 수집 유효기간 1. 나의 풀이 (개월 수가 기준이 이므로 정직하게 개월 수로 계산한 풀이)def time_diff(today, privacies): diffs = [] t_year, t_month, t_day = map(int, today.split('.')) for pri in privacies: p_type = pri[-1] # 약관 유형 pri = pri[:-2] # 약관 시작 날짜 p_year, p_month, p_day = map(int, pri.split('.')) diff = ((t_year - p_year) * 12) + (t_month - p_month) # 만약 day가 지나지 않았다면, 개월 수 -1을 해줘야 한다. .. 2024. 6. 30. 이전 1 다음