2026-03-30 19:50:10 +0300 MSK

Check if Strings Can be Made Equal With Operations II

Code

class Solution:
    def checkStrings(self, s1: str, s2: str) -> bool:
        return Counter(s1[::2]) == Counter(s2[::2]) and Counter(
            s1[1::2]
        ) == Counter(s2[1::2])