Notice
Recent Posts
Recent Comments
Link
목록3986 (1)
clohi 님의 블로그
[BOJ / Python] 3986 : 좋은 단어
https://www.acmicpc.net/problem/3986 문제 코드 import sysinput = sys.stdin.readlinen = int(input())cnt = 0for i in range(n): word = input().rstrip() stack = [] for j in range(len(word)): if(stack and stack[-1] == word[j]): stack.pop() else: stack.append(word[j]) if(not stack): cnt += 1print(cnt) 문제 풀이 - 자료구조(스택) 문제만 이해하면 쉽게 풀 수 있는 문제다. 단어의 왼쪽 글..
Algorithm/BOJ
2025. 7. 5. 20:31
