Search
⌘K

Leetcode 2839. Check if Strings Can be Made Equal With Operations I

Given two length-4 strings where the only allowed operation is swapping characters at indices that differ by 2 (i.e., 0↔2 or 1↔3), determine whether s1 can be transformed into s2. This reduces to checking that the multisets of characters at even indices and at odd indices are the same in both strings.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.