science. He needs to change over string an into string b by playing out a few (perhaps zero) procedure on a. In one action, he can by the same token pick a list I (1≤i≤n−1) and trade man-made intelligence and ai+1, or pick a file I (1≤i≤n−k+1) and if ai,ai+1,… ,ai+k−1 are altogether equivalent to some character
Correct answer will be upvoted else Multiple Downvoted. Computer science.
He needs to change over string an into string b by playing out a few (perhaps zero) procedure on a.
In one action, he can by the same token
pick a list I (1≤i≤n−1) and trade man-made intelligence and
pick a file I (1≤i≤n−k+1) and if ai,ai+1,… ,ai+k−1 are altogether equivalent to some character c (c≠ 'z'), supplant every one with the following character (c+1), that is, 'a' is supplanted by 'b', 'b' is supplanted by 'c, etc.
Note that he can play out quite a few activities, and the tasks must be performed on string a.
Assist Ashish with deciding whether it is feasible to change over string an into b in the wake of playing out a few (potentially zero) procedure on it.
Input
The main line contains a solitary integer t (1≤t≤105) — the number of experiments. The depiction of each experiment is as per the following.
The main line of each experiment contains two integers n (2≤n≤106) and k (1≤k≤n).
The second line of each experiment contains the string an of length n comprising of lowercase English letters.
The third line of each experiment contains the string b of length n comprising of lowercase English letters.
It is ensured that the amount of qualities n among all experiments doesn't surpass 106.
Output
For each experiment, print "Yes" if Ashish can change over an into b after certain moves, else print "No".
You might print the letters of the appropriate response regardless (upper or lower).
Step by step
Solved in 4 steps with 1 images