백준 24839번: Speed Typing #Python

ColorlessDia·2024년 11월 28일

algorithm/baekjoon

목록 보기
375/808
import sys

T = int(sys.stdin.readline())

for t in range(1, T + 1):
    I = sys.stdin.readline().rstrip()
    P = sys.stdin.readline().rstrip()

    i = 0
    d = 0

    for p in P:
                
        if len(I) <= i or p != I[i]:
            d += 1
            continue
        
        i += 1

    if len(I) == i:
        print(f'Case #{t}: {d}')
    else:
        print(f'Case #{t}: IMPOSSIBLE')

0개의 댓글