programmers 다리를 지나는 트럭
분류 / 레벨 / 언어
스택,큐 / LV.2 / Javscript
설명
스택, 큐를 사용하여 상황을 잘 표현해야 하는 문제이다.
while{} 안에서 time++를 하여 타이머를 잰다.
그리고 while{} 안에서 1초 동안 발생하는 이벤트를 표현해주면 된다.
전체 코드
1 | function solution(bridge_length, weight, truck_weights) { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
