first and second, each of length 4. On either string you may repeat this move any number of times: pick positions i and j with j - i = 2 and swap the letters at them.
Return True if the strings can be made identical, and False otherwise.first="mark", second="rkma" → True
Swap positions 0 and 2 to get "ramk", then 1 and 3 to get "rkma".
first="mark", second="amrk" → False
The letter m sits at an odd position, but second needs it at an even one, which it can never reach.
first="mark", second="rkma"
True
Run checks the first 3 tests in your browser. Submit checks all 65 tests on the server, hidden ones included.