[알고리즘/백준] 1543번 : 문서 검색(python)

유현민·2022년 3월 15일
0

알고리즘

목록 보기
55/253

글자 하나씩 가져와서 넣고 안에 해당 글자가 있으면 초기화 한다.

word = list(map(str, input()))
key = input()
tmp = ''
cnt = 0
for i in word:
    tmp += i
    if key in tmp:
        cnt += 1
        tmp = ''
print(cnt)
profile
smilegate megaport infra

0개의 댓글