1406

https://www.acmicpc.net/problem/1406  스택 혹은 큐를 활용해서 풀면 되는 문제.커서를 기준으로 left, right 두 스택 혹은 큐로 나눠서 로직을 구현하면 된다.  처음에는 스택을 활용해서 풀었다.import sysinput = sys.stdin.readlineleft = list(input().rstrip())right = []n = int(input()) # 명령 개수for _ in range(n): command = input().rstrip() if command == 'L': if left: char = left.pop() right.append(char) elif command == 'D': ..
happenundo
'1406' 태그의 글 목록