[Python] Simple One Pass O(N) Solution
Iterate from left to right, to check if there are enough R.\nIterate from right to left, to check if there are enough L.\n\nclass Solution:\n    def canTransfor
Iterate from left to right, to check if there are enough ```R```.\nIterate from right to left, to check if there are enough ```L```.\n```\nclass Solution:\n    def canTransform(self, start: str, end: str) -> bool:\n        L = R = 0\n        for i in range(len(start)):\n            a, b = start[i], end[i]\n            R = R + 1 if a == \'R\' else (0 if a == \'L\' else R)\n            if b == \'R\' and not R:\n                return False\n            R -= b == \'R\'\n            \n            j = len(start) - 1 - i\n            c, d = start[j], end[j]\n            L = L + 1 if c == \'L\' else (0 if c == \'R\' else L)\n            if d == \'L\' and not L:\n                return False\n            L -= d == \'L\'\n        \n        return L == R == 0\n```
[]