[Explained] Python simple and concise solution
IDEA: \n1. As \'L\' and \'R\' are only swapped with \'X\', thus if we take out all \'X\'s from both start and end strings, the remaining strings should have the
IDEA: \n1. As \'L\' and \'R\' are only swapped with \'X\', thus if we take out all \'X\'s from both start and end strings, the remaining strings should have the following properties:\n\ta. same total length.\n\tb. same number and order w.r.t. \'L\' and \'R\'.\n2. As len(start) = len(end) is given in the problem description, this means the number of \'X\' in both string should be the same as well considering the point above. \n3. We use two pointers one for the start string, one for the end string. When start pointer is pointing to the ```nth``` non-\'X\' char, the char that the end pointer is pointing to the ```nth``` non-\'X\' char should be the same, i.e. if the char in start string is a \'L\', the end pointer should be pointing to a \'L\' as well.\n4. As \'L\' can only move to the left of its index in start string, when we go through two strings using two pointers, the pointer index in the end string for ```nth``` \'L\' should be only smaller or equal than the pointer index pointing to the ```nth``` \'L\' in the start string. Same idea for \'R\', except now the end pointer index should be equal or larger than the start pointer index.\n5. Time complexity: O(n) where n is the length of the start string. As we only go through it once. ```.count()``` is a O(n) as well. Space Complexity: O(1). Constant spaces used for variables. \n\n```\ndef canTransform(self, start: str, end: str) -> bool:\n        if start.count(\'X\') != end.count(\'X\'): \n            return False\n        \n        n = len(start)\n        i = j = 0\n        \n        while i < n and j < n: \n            if start[i] == \'X\': \n                i += 1\n                continue\n            if end[j] == \'X\':\n                j += 1\n                continue\n            \n            if start[i] != end[j]: return False\n            if start[i] == \'L\' and i < j: return False\n            if start[i] == \'R\' and i > j:  return False\n            \n            i += 1\n            j += 1\n        \n        return True\n```
['Python']