General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
195680452 Contestant:
minjuun
1800E2 - 31 Python 3 Accepted 187 ms 3056 KB 2023-03-02 19:18:41 2023-03-03 15:13:40
→ Source
t = int(input())
for _ in range(t):
    ret = 'YES'

    n, k = list(map(int, input().split(' ')))
    s = input()
    t = input()

    for i in range(max(n - k, 0), min(k, n)):
        if s[i] != t[i]:
            ret = 'NO'

    if sorted(s) != sorted(t):
        ret = 'NO'

    print(ret)
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details