알고리즘
프로그래머스 JS | 다리를 지나는 트럭
❌ Solution ( 14.3 / 100 ) function solution(bridge_length, weight, truck_weights) { const totalTrucks = truck_weights.length; let timer = 0; let load = 0; const onBridge = []; const complete = []; while(totalTrucks !== complete.length) { if( load + truck_weights[0] bridge_length) { const del = onBridge[onBridge.length-1]; if (del !== 0) load = load - del; complete.push(del); onBridge.pop(); } co..