You are given two strings $s$ and $t$, each string consists of $n$ lowercase English letters.
You can perform the following operation on string $s$:
flybutter
we can split it into fly
and butter
, then after swapping their order the string $s$ will become butterfly
,Your task is to find the minimum number of required Split and Swap
operations to make string $s$ equal to string $t$. It is always possible to achieve that for the given input.
The first line of the input contains a single integer $T$ ($1 \le T \le 100$), the number of test cases.
The first line of each test case contains a single integer $n$ ($1 \le n \le 10^5$), the length of each of the strings.
Each of the following two-line contains a string of $n$ lowercase English letters, representing string $s$ and $t$, respectively.
It is guaranteed that it is possible to make string $s$ equal to string $t$ using zero or more Split and Swap
operations.
The total sum of $n$ over all test cases doesn't exceed $2 \times 10^6$.
For each test case, print a single line with the minimum number of required Split and Swap
operations to make string $s$ equal to string $t$.
Input | Output |
---|---|
2 9 flybutter butterfly 4 jcpc jcpc Copy
|
1 0 Copy
|