Problem
You are given 2 strings \(s\) and \(t\) both containing only lowercase English characters with s containing some \(?\) as well. You can swap characters at positions \(i\) and \(j\) in the string \(s\) (\(j\gt i\)) any number of times and can also replace any \(?\) with any lowercase English character. Can you convert \(s\) into \(t\) ?
Input Format
- The first line contains an integer \(T\) denoting the number of test cases.
- The first line of each test case contains an integer \(N\), the length of the strings.
- The second line of each test case contains \(N\) lowercase English characters with some \(?\)(possibly \(0\)) denoting string \(s\).
- The third line of each test case contains \(N\) lowercase English characters denoting string \(t\).
Output Format
For each test case, print '\(Yes\)' (without quotation marks) if it is possible to convert \(s\) into \(t\).Otherwise, print '\(No\)' (without quotation marks). Print the output in a new line.
Constraints
\(1 \le T \le 10\)
\(1 \le N \le 10^5\)
In the first sample, we can replace first \(3\) \(?\) with characters a,m, a respectively to obtain the final string.
In the second sample, we can swap \(3^{rd}\) and \(4^{th}\) characters to get our final string.
In the third testcase, no matter what we do, we cannot convert \(s\) into \(t\).
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor