본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 6550번 부분 문자열

by 현장 2022. 5. 13.

-Code

while 1:
    try:
        s, t = input().split()
        line = ""
        position = 0
        for i in range(len(s)):
            for j in range(position, len(t)):
                if s[i] == t[j]:
                    line += s[i]
                    position = j + 1
                    break
        print("Yes" if s == line else "No")
    except:
        break