~17 lines, Simple O(N) Python soln
Insight:\nWithout loss of generality, let\'s consider left pieces only.\n - Ls can move left, if there are spaces before the L\n - Ls can cross over lefts while
Insight:\nWithout loss of generality, let\'s consider left pieces only.\n - Ls can move left, if there are spaces before the L\n - Ls can cross over lefts while moving, but cannot cross over Rs, therefore\n   using a counter for number of available lefts is viable.  This counter is reset to 0\n   if we see a right in the way.  If there\'s a left we cannot match, we return false, too.\n\n```\n    def canChange(self, start, target):\n        N = len(start)\n        \n        curr = 0\n        for i in range(N - 1, -1, -1):\n            if start[i] == \'L\': curr += 1\n            elif start[i] == \'R\': curr = 0\n            if target[i] == \'R\' and curr > 0: return False \n            if target[i] == \'L\':\n                if curr == 0: return False\n                curr -= 1\n        \n        for i in range(N):\n            if start[i] == \'R\': curr += 1\n            elif start[i] == \'L\': curr = 0\n            if target[i] == \'L\' and curr > 0: return False \n            if target[i] == \'R\':\n                if curr == 0: return False\n                curr -= 1\n        return True\n```\n
[]