Source Code
it=int(input())
for i in range(it):
    size=int(input())
    a =input()
    b =input()
    t = 0
    i = 0
    j = 0 
    while a != b:
            t = b.find(a[i])
            b = b[t:] + b[i:t-1]
        i += 1
    print(j)
Copy
Split and Swap azoz1111111
Python 3
0 ms
0 KB
Compilation Error