[SWEA] 3143 가장 빠른 문자열 타이핑

김은서·2021년 8월 18일
0

SWEA

목록 보기
25/47

Python code

import sys
sys.stdin = open("input.txt")
N = int(input())
for tc in range(1, N+1):
    str1, str2 = map(str, input().split())
    if str2 in str1:
        cnt = str1.count(str2)
    total = cnt + len(str1)-len(str2)*cnt
    print('#{} {}'.format(tc, total))
profile
Gracelog

0개의 댓글