Two answers, both simple, both at 100% speed rank
Intuition\n Describe your first thoughts on how to solve this problem. \nFirst Solution: Take note of which characters are in odd/even placement in their respec
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nFirst Solution: Take note of which characters are in odd/even placement in their respective strings.\n\nSecond Solution: Make the three possible "True" alternates of a string and check the second string against all four possibilities.  \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFirst Solution:\n1) If the set of s1 and set of s2 don\'t match, return False.\n2) Otherwise, I\'ll make a list of sets for both strings (List-Iteration). --Each set will include the character and a digital rep for it\'s odd/even placement on the string (0 => odd, 1 = even).\n3) Iterate through the sets in the first list. --If the current set can\'t be found in the list that represents the second string, return False.\n4) If all those checks passed, return True.\n\nSecond Solution:\n1) Create 3 variables to represent the other "True" variations of the first string (the first string is already the first "True" variation of itself).\n2) Return the result of four seperate checks between the "True variations" of the first string against the second (in an "or" statement since only one variation needs to match).\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n) (n => the 8 characters of the combined strings)\nAlthough we iterate through all characters of the strings a multiple of times in each scenario, we disregard that constant multiple.\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\nIn the first answer, we create two lists that combine into double the amount of data in reflection to the amount of characters in the combination of both strings.\nIn my second answer, we create three more strings, a combined amount of characters equal to 1 1/2 * the amount of characters in the combo of both strings.\nStill, we disregard those constant multiples.\n\n# Code\n```python3 []\nclass Solution:\n    def canBeEqual(self, s1: str, s2: str) -> bool:\n        # SECOND ANSWER - SIMPLE COMPARISONS - SPACE: 16.70MB/Beats 18.88%\n        new1a = s1[2: ] + s1[: 2]\n        new1b = s1[2] + s1[1] + s1[0] + s1[3]\n        new1c = s1[0] + s1[3] + s1[2] + s1[1]\n\n        return (s1 == s2 or new1a == s2 or new1b == s2 or new1c == s2)\n\n        # FIRST ANSWER - SET-CHECKS AND LIST ITERATION - SPACE: 16.58MB/Beats 58.74%\n        # if set(s1) != set(s2):\n        #     return False\n\n        # list1 = [(c, i % 2 )for i, c in enumerate(s1)]\n        # list2 = [(c, i % 2) for i, c in enumerate(s2)]\n\n        # for item in list1:\n        #     if item not in list2:\n        #         return False\n        # return True\n\n```
['Python3']