문제
https://www.acmicpc.net/problem/9996
접근
- 정규식 사용
풀이
import re
n = int(input())
s = input()
idx = s.index("*")
pattern = s[:idx] + "[a-z]*" + s[idx + 1:]
p = re.compile(pattern)
for _ in range(n):
t = input()
if p.fullmatch(t):
print("DA")
else:
print("NE")
'Python > Coding Test' 카테고리의 다른 글
15728 에리 - 카드 (0) | 2022.02.22 |
---|---|
16933 벽 부수고 이동하기 3 (0) | 2022.02.22 |
10165 버스 노선 (0) | 2022.02.17 |
2749 피보나치 수 3 (0) | 2022.02.16 |
21939 문제 추천 시스템 Version 1 (0) | 2022.02.16 |