코드
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
\