๐ฃ ๊ฐ์ธ์ ๋ณด ์์ง ์ ํจ๊ธฐ๊ฐ
1. ๋ฌธ์ ๋งํฌ
2023 KAKAO BLIND RECRUITMENT: ๊ฐ์ธ์ ๋ณด ์์ง ์ ํจ๊ธฐ๊ฐ
2. ์ฝ๋
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# time : 9'
def solution(today, terms, privacies):
answer = []
today_split = today.split('.')
# ์ค๋ ๋ ์ง -> ๋
๋ ํฌํจ date_time์ผ๋ก ๋ณํ
date_time_today = int(today_split[0]) * 28 * 12 \
+ int(today_split[1]) * 28 \
+ int(today_split[2])
valid_time = {} # ๋ง๋ฃ ๊ธฐ๊ฐ ํ์
๋์
๋๋ฆฌ ํํ๋ก ํ์ฑ
for t in terms:
tt = t.split()
valid_time[tt[0]] = int(tt[1]) * 28
for p in range(len(privacies)):
privacies_time, privacies_type = privacies[p].split() # ์๊ฐ, ํ์
๋ฃ์ด์ค
privacies_split = privacies_time.split('.')
date_time_p = int(privacies_split[0]) * 28 * 12 \
+ int(privacies_split[1]) * 28 \
+ int(privacies_split[2]) \
+ valid_time[privacies_type]
if date_time_p <= date_time_today: # ์ค๋ ๋ ์ง ๊ธฐ์ค ๋น๊ต
answer.append(p + 1)
return answer
This post is licensed under CC BY 4.0 by the author.