[Programmers | Level 2] 다리를 지나는 트럭 (Python)
from collections import deque def solution(bridge_length, weight, truck_weights): truck_weights = deque(truck_weights) bridge = deque([0 for _ in range(bridge_length)]) t = 0 bridge_weight = 0 while len(bridge) != 0: pass_truck = bridge.popleft() bridge_weight -= pass_truck t += 1 if truck_weights: if bridge_weight + truck_weights