<p>You are given two strings <code>s1</code> and <code>s2</code>, both of length <code>4</code>, consisting of <strong>lowercase</strong> English letters.</p>

<p>You can apply the following operation on any of the two strings <strong>any</strong> number of times:</p>

<ul>
	<li>Choose any two indices <code>i</code> and <code>j</code> such that <code>j - i = 2</code>, then <strong>swap</strong> the two characters at those indices in the string.</li>
</ul>

<p>Return <code>true</code><em> if you can make the strings </em><code>s1</code><em> and </em><code>s2</code><em> equal, and </em><code>false</code><em> otherwise</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> s1 = &quot;abcd&quot;, s2 = &quot;cdab&quot;
<strong>Output:</strong> true
<strong>Explanation:</strong> We can do the following operations on s1:
- Choose the indices i = 0, j = 2. The resulting string is s1 = &quot;cbad&quot;.
- Choose the indices i = 1, j = 3. The resulting string is s1 = &quot;cdab&quot; = s2.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> s1 = &quot;abcd&quot;, s2 = &quot;dacb&quot;
<strong>Output:</strong> false
<strong>Explanation:</strong> It is not possible to make the two strings equal.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>s1.length == s2.length == 4</code></li>
	<li><code>s1</code> and <code>s2</code> consist only of lowercase English letters.</li>
</ul>

class Solution:
    def canBeEqual(self, s1: str, s2: str) -> bool:
        # If the strings are already equal, return True
        if s1 == s2:
            return True

        # Define a function to perform the swap operation
        def swap_chars(s, i, j):
            s_list = list(s)
            s_list[i], s_list[j] = s_list[j], s_list[i]
            return ''.join(s_list)

        # Check if we can transform s1 to s2 using the swap operation
        # Swap characters at indices (0, 2)
        s1_swapped = swap_chars(s1, 0, 2)
        if s1_swapped == s2:
            return True

        # Swap characters at indices (1, 3)
        s1_swapped = swap_chars(s1, 1, 3)
        if s1_swapped == s2:
            return True

        # Swap characters at indices (0, 2) and then (1, 3)
        s1_swapped = swap_chars(s1, 0, 2)
        s1_swapped = swap_chars(s1_swapped, 1, 3)
        if s1_swapped == s2:
            return True

        # Swap characters at indices (1, 3) and then (0, 2)
        s1_swapped = swap_chars(s1, 1, 3)
        s1_swapped = swap_chars(s1_swapped, 0, 2)
        if s1_swapped == s2:
            return True

        # If none of the above transformations work, return False
        return False

# Example usage:
solution = Solution()
print(solution.canBeEqual("abcd", "cdab"))  # Output: True
print(solution.canBeEqual("abcd", "dacb"))  # Output: False
24