Python with explanation
\nclass Solution:\n    def canTransform(self, start: str, end: str) -> bool:\n        # replace x with empty string to make sure the left R and L are in same or
```\nclass Solution:\n    def canTransform(self, start: str, end: str) -> bool:\n        # replace x with empty string to make sure the left R and L are in same order\n        if start.replace("X","") != end.replace("X",""):\n            return False\n        n = len(start)\n        i = j = 0\n        # check the index of L in start is more than end(Only XL to LX, L index decrease )\n        # check the index of R in start is less than end (Only RX to XR, R index increase )\n        while True:\n            while i < n and start[i] == "X":\n                i += 1\n            while j < n and end[j] == "X":\n                j += 1\n            #if approach the end of start, all the L R statisfied the requirement\n            if i == n: return True\n            if start[i] == "L" and i < j: return False\n            if start[i] == "R" and i > j: return False\n            i += 1\n            j += 1\n        return True\n        \n```
[]