Lv3 프로그래머스(Programmers)[Python][파이썬] 추석 트래픽

"""
출처:프로그래머스
https://school.programmers.co.kr/learn/courses/30/lessons/17676
"""

# 풀이 과정
# 누적합
from collections import defaultdict

Data = [0] * 24 * 60 * 60 * 1000


# for s in range(24*60*60):
# Data[s]=0

def time_to_sec(x, y):
global Data

t = x.split(":")
hour, minu, sec = int(t[0]), int(t[1]), float(t[2])
end_time = (int(hour) * 60 * 60 + int(minu) * 60 + sec) * 1000

blank = list(y)
blank.pop()
y = "".join(blank)

# 시작 시간, 끝 시간
start = end_time - float(y) * 1000 + 1
start = max(0, start)
end_time = min(24 * 60 * 60 * 1000 - 1, end_time + 999)
start, end = int(start), int(end_time)

for tra in range(start, end + 1):
Data[tra] += 1

return 0


def solution(lines):
global Data

for l in lines:
d = l.split(" ")
time = time_to_sec(d[1], d[2])

result = 0
count = 0
result = max(Data)

return result