티스토리 뷰
📚 문제
입력
출력
예제 입력 1
5 11
baekjoononlinejudge
startlink
codeplus
sundaycoding
codingsh
baekjoon
codeplus
codeminus
startlink
starlink
sundaycoding
codingsh
codinghs
sondaycoding
startrink
icerink
예제 출력 1
4
🧑🏻💻 풀이 과정
- 검사할 문자를 반복하며 하나씩 꺼내서 검사할 문자열과 일치하는 문자가 있으면
cnt
를 1 증가시키자.
def set_words(check_word):
cnt = 0
for i, str in enumerate(check_word):
if str in s:
cnt += 1
return cnt
n, m = map(int, input().split())
s = [input() for _ in range(n)]
check_word = [input() for _ in range(m)]
print(set_words(check_word))
'알고리즘' 카테고리의 다른 글
[algorithm] 백준 9414 - 프로그래밍 대회 전용 부지 (파이썬) (0) | 2022.08.05 |
---|---|
[algorithm] 백준 11536 - 줄 세우기 (파이썬) (0) | 2022.07.30 |
[algorithm] 백준 15903 - 카드 합체 놀이 (c++) (0) | 2022.07.28 |
[algorithm] 백준 11047 - 동전 0 (c++) (0) | 2022.07.27 |
[algorithm] 백준 1343 - 폴리오미노 (파이썬) (0) | 2022.07.26 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 백준
- 정렬
- 자료구조
- 스프링
- 스프링부트
- 김영한
- 그리디
- leetcode
- 파이썬
- 구현
- Algorithm
- 인프런
- 북클럽
- MySQL
- 문자열
- spring boot
- mysql 8.0
- 코틀린
- 노마드코더
- 스프링 부트
- 리팩토링
- kotlin
- 데이터베이스
- 노마드
- 코테
- Spring
- Real MySQL
- 알고리즘
- webflux
- 릿코드
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함