?
# | Author | Problem | Lang | Verdict | Time | Memory | Sent | Judged | |
---|---|---|---|---|---|---|---|---|---|
209626136 |
Practice: Harshitha_46 |
1800E2 - 31 | PyPy 3 | Accepted | 499 ms | 12036 KB | 2023-06-14 07:45:21 | 2023-06-14 07:45:21 |
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 sorted(s1)==sorted(s2) and s1[i:-i] ==s2[i:-i] else "NO")
?
?
?
?