[프로그래머스/파이썬] 배달
처음 이 문제를 보자마자 이건 딕셔너리에 {출발지: [(도착지, 시간), (도착지, 시간), ...], 출발지: [...], ...} 이런식으로 우선 풀어서, 재귀로 누적 시간을 잰다음 K보다 시간이 작은지 체크하고 list에 넣어야겠다 라고 생각하고 이렇게 풀었다. def solution(N, road, K): towns = [500000] * (N+1) graph = collections.defaultdict(list) for r in road: a, b, time = r graph[a].append((b, time)) graph[b].append((a, time)) def go_delivery(visited: list, arrive: int, time: int): for a, t in graph[v..