Python3 simple solution: Beats 100% in speed
Intuition\n Describe your first thoughts on how to solve this problem. \nWe keep track of possible Ls and Rs to keep track of, so that they can be accounted for
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe keep track of possible Ls and Rs to keep track of, so that they can be accounted for by future characters. This is kept track of in the lCount and rCount variables.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def canTransform(self, start: str, end: str) -> bool:\n        lCount = 0\n        rCount = 0\n        n = len(start)\n        for i in range(n):\n            s = start[i]; e = end[i]\n            if s == \'L\' and rCount > 0:\n                return False\n            if e == \'R\' and lCount > 0:\n                return False\n            if e == \'L\':\n                lCount += 1\n            if s == \'R\':\n                rCount += 1\n            if s == \'L\':\n                if lCount > 0:\n                    lCount -= 1\n                else:\n                    return False\n            if e == \'R\':\n                if rCount > 0:\n                    rCount -= 1\n                else:\n                    return False\n        return lCount == 0 and rCount == 0\n        \n```
['Python3']