General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
203727990 Practice:
JR_prac
1800E2 - 31 Python 3 Accepted 217 ms 996 KB 2023-04-27 21:29:10 2023-04-27 21:29:10
→ Source
from collections import Counter
for _ in range (int(input())):
    n,k=map(int,input().split())
    s1=input();s2=input()
    if n<=k:
        print('YES' if s1==s2 else 'NO')
    else:
        i=n-k
        print("YES" if Counter(s1)==Counter(s2) and s1[i:-i] ==s2[i:-i] else "NO")
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details