/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 16ms 3.141 MiB
#2 Accepted 15ms 3.0 MiB
#3 Accepted 16ms 3.066 MiB
#4 Accepted 16ms 3.043 MiB
#5 Accepted 17ms 2.98 MiB
#6 Accepted 16ms 2.98 MiB
#7 Accepted 15ms 2.926 MiB

Code

def jjk(S, N):
    i = 0
    j = 0
    while i < len(S) and j < len(N):
        if S[i] == N[j]:
            i += 1
            j += 1
        else:
            i += 1
    return j == len(N)


T = int(input())
if 1<=T<=100:

    for i in range(T):

        S = input()
        N = input()

        result = jjk(S, N)

        if result:
            print("YES")
        else:
            print("NO")

Information

Submit By
Type
Submission
Problem
P1020 Favourite footballer
Contest
Brain booster - 1
Language
Python 3 (Python 3.12.3)
Submit At
2023-12-31 16:06:45
Judged At
2024-10-03 14:04:54
Judged By
Score
100
Total Time
17ms
Peak Memory
3.141 MiB