def solution(today, terms, privacies):
today = today.split(".")
for i in range(3):
today[i] = int(today[i])
nterms = {}
for t in terms:
nterms[t.split(" ")[0]] = int(t.split(" ")[1])
dates = []
periods = []
for p in privacies:
dates.append((p.split(" ")[0]).split("."))
periods.append(p.split(" ")[1])
for i in range(len(dates)):
for j in range(3):
dates[i][j] = int(dates[i][j])
answer = []
for i in range(len(privacies)):
if dates[i][2] - 1 < 1:
dates[i][1] -= 1
dates[i][2] -= 1 + 28
else:
dates[i][2] -= 1
if dates[i][1] + nterms[periods[i]] > 12:
dates[i][0] += 1
dates[i][1] += nterms[periods[i]] - 12
elif dates[i][1] + nterms[periods[i]]<1:
dates[i][0] -= 1
dates[i][1] += nterms[periods[i]] + 12
else:
dates[i][1] += nterms[periods[i]]
if dates[i][0] < today[0]:
answer.append(i + 1)
elif dates[i][0] == today[0]:
if dates[i][1] < today[1]:
answer.append(i + 1)
elif dates[i][1] == today[1]:
if dates[i][2] < today[2]:
answer.append(i + 1)
return answer
[출처] 2023 카카오 신입 개발자 공채 1번|작성자 Daisy
https://brorica.tistory.com/entry/2023-카카오-신입-개발자-코테-1-2차-후기
2023 카카오 신입 개발자 코테 1, 2차 후기
결론부터 말하면 2차 코테 부분에서 탈탈 털렸다. 1차 1, 2, 3, 4 해서 총 4솔했다. 7문제로 구성됐으며, 올해 1차는 구현 요소가 많았다. 5번까지는 구현이 좀 필요했지만, 구현 문제를 좋아하다
brorica.tistory.com
https://kth990303.tistory.com/379
[220924] 2023 KAKAO BLIND RECRUITMENT 코딩테스트 1차 후기
https://career.programmers.co.kr/competitions/2759 2023 KAKAO BLIND RECRUITMENT career.programmers.co.kr 2023 카카오 코딩테스트에 응시해보았다! 카카오는 내가 가고 싶은 기업 중 하나이기도 하고, 카카..
kth990303.tistory.com