2840. Check if Strings Can be Made Equal With Operations II
You are given two strings
s1ands2, both of lengthn, consisting of lowercase English letters.You can apply the following operation on any of the two strings any number of times:
- Choose any two indices
iandjsuch thati < jand the differencej - iis even, then swap the two characters at those indices in the string.Return
trueif you can make the stringss1ands2equal, andfalseotherwise.
1 | class Solution { |