Clean Python Solution (Self-Explained, Easy to Understand)
python\n"""\n1. Check if the sequence of L and R are the same.\n2. Check if the index of L in the "start" are larger than index of the L in the "end", since L c
```python\n"""\n1. Check if the sequence of L and R are the same.\n2. Check if the index of L in the "start" are larger than index of the L in the "end", since L can only move left.\n3. Check if the index of R in the "start" are smaller than index of the R in the "end", since R can only move left.\n"""\nclass Solution(object):\n    def canTransform(self, start, end):\n        if len(start)!=len(end): return False\n        if start.replace(\'X\', \'\')!=end.replace(\'X\', \'\'): return False #[1]\n        \n\t\t#[2]\n        startLIndex = [i for i, c in enumerate(start) if c==\'L\']\n        endLIndex = [i for i, c in enumerate(end) if c==\'L\']\n        for i in xrange(len(startLIndex)):\n            if startLIndex[i]<endLIndex[i]:\n                return False\n        \n\t\t#[3]\n        startRIndex = [i for i, c in enumerate(start) if c==\'R\']\n        endRIndex = [i for i, c in enumerate(end) if c==\'R\']\n        for i in xrange(len(startRIndex)):\n            if startRIndex[i]>endRIndex[i]:\n                return False\n        \n        return True\n\t\t\n"""\nFor interview preparation, similar problems, check out my GitHub.\nIt took me a lots of time to make the solution. Becuase I want to help others like me.\nPlease give me a star if you like it. Means a lot to me.\nhttps://github.com/wuduhren/leetcode-python\n"""\n```
[]