BOJ - 14405 - 피카츄

Updated:

def solution():
    S = str(input())

    while True:

        if S[0:2] == "pi":
            S = S[2:]
            continue
        elif S[0:2] == "ka":
            S = S[2:]
            continue
        elif S[0:3] == "chu":
            S = S[3:]
            continue

        if len(S)==0:
            print("YES")
            return
        else:
            print("NO")
            return
solution()

https://www.acmicpc.net/problem/14405

Categories:

Updated:

Leave a comment