[스택, 큐] 오큰수 구하기 (백준 17298)
·
Baekjoon
import sysinput = sys.stdin.readlinefrom collections import dequeN = int(input())array = list(map(int, input().split()))answer = [-1]*(N)mystack = deque([]) # index 담기for i in range(N): while mystack and array[mystack[-1]]