백준 1406 파이썬
[백준 알고리즘] 1406번 에디터, 파이썬(python)
[백준 알고리즘] 1406번 에디터, 파이썬(python)
2021.07.311406, 에디터 📁 문제 출처 https://www.acmicpc.net/problem/1406 💡 생각 index를 사용해서 커서의 위치를 컨트롤하여 작업을 수행해야겠다는 아이디어를 떠올림 시간 초과가 발생 도저히 생각이 안 나서 스택 2개를 가지고 풀이한 것을 참고. s2은 deque를 사용하여 왼쪽에서 원소를 넣었다 뺄 수 있게 하였다. ❌ 틀린 코드 import sys words = list(sys.stdin.readline().strip()) n = int(sys.stdin.readline()) index = len(words) for i in range(n): order = sys.stdin.readline().strip().split() if order[0] == "P": words.ins..