Haribo ML, AI, MATH, Algorithm

개인정보 수집 유효기간

2023-11-23
Haribo

개인정보 수집 유효기간

코드

from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
def solution(today,	terms,	privacies):
    terms = {term.split(' ')[0]:int(term.split(' ')[1]) for term in terms}
    today = datetime.strptime(today,'%Y.%m.%d')
    answer = []
    for idx, info in enumerate(privacies) :
        date, type = info.split(' ')
        date = datetime.strptime(date,'%Y.%m.%d') + relativedelta(months=+terms[type])
        if date <= today :
            answer.append(idx+1)

    return answer

\


다음 포스트 이모티콘 할인행사

Comments

Content