General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
204335851 Practice:
majooni
1800E2 - 31 PyPy 3-64 Accepted 405 ms 21744 KB 2023-05-03 15:49:22 2023-05-03 15:49:22
→ Source
for _ in range(int(input())) :
    length , k = list(map(int,input().split()))
    inp1 = input()
    inp2 = input()

    if length <= k :
        print('YES' if inp1 == inp2 else 'NO')
    else:
        i = length - k
        print("YES" if sorted(inp1) == sorted(inp2) and inp1[i:-i] == inp2[i:-i] else "NO")
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details