250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- 아티클스터디
- 반복문
- map
- 내배캠_학습기록
- 통계학
- 데이터시각화
- 가설검정
- SQL
- 내일배움일지
- 내일배움캠프
- Leetcode
- python
- 태블로
- Set
- 이중for문
- Join
- 다중공선성
- 선형회귀
- AB테스트
- 데이터전처리
- SQLD
- ★
- 한줄for문
- f-string
- 프로그래머스
- Til
- 시각화
- 리스트
- DATE_SUB
- Max
Archives
- Today
- Total
노력에는 지름길이 없으니까요
LeetCode - 1967. Number of Strings That Appear as Substrings in Word 본문
Python/프로그래머스
LeetCode - 1967. Number of Strings That Appear as Substrings in Word
데건 2024. 9. 13. 22:50728x90
해결일 | 언어 | 레벨 | 테스트명 |
20240913 | Python | easy | 1967. Number of Strings That Appear as Substrings in Word |
링크 : https://leetcode.com/problems/number-of-strings-that-appear-as-substrings-in-word/
내 코드
class Solution:
def numOfStrings(self, patterns: List[str], word: str) -> int:
ans = 0
for pattern in patterns :
if pattern in word:
ans += 1
return ans
문자열이 부분일치하는 지 확인하려면 in을 사용하면 된다.
728x90
반응형
'Python > 프로그래머스' 카테고리의 다른 글
LeetCode - 1837. Sum of Digits in Base K (Python ver.) (2) | 2024.09.16 |
---|---|
LeetCode - 1748. Sum of Unique Elements (Python ver.) (0) | 2024.09.16 |
LeetCode - 13. Roman to Integer (Python ver.) (0) | 2024.09.06 |
LeetCode - 9. Palindrome Number (Python ver.) (0) | 2024.09.04 |
프로그래머스 - (★) 숫자의 표현 (Python ver.) (0) | 2024.09.03 |