Python3 O(n) one pass 112 ms
``` class Solution:     def canTransform(self, start, end):         """         :type start: str         :type end: str         :rtype: bool         """        
```
class Solution:
    def canTransform(self, start, end):
        """
        :type start: str
        :type end: str
        :rtype: bool
        """
        swap = {'R':'X', 'X':'L'}
        
        # print("CanTransform: ", start, end)
        if len(start)!=len(end):
            return False
        
        if start==end:
            return True
        
        dic = collections.Counter(start)
        for c in end:
            dic[c] -= 1
            if dic[c]<0:
                return False
        
        length = len(start)
        r = length-1
        
        idx = r
        laste = end[r]
        
        while r>0:
            while r>=0 and start[r]==end[r]:
                r -= 1
            if r<=0:
                return True
            if end[r]=='L':
                return False
            
            if end[r]!=laste:
                idx = r
            else:
                idx = min(r, idx)
                
            laste = end[r]
            
            while start[idx]!=end[r]:
                if start[idx]!=swap[end[r]]:
                    return False
                idx -= 1
            if idx<0:
                return False
            if idx==r:
                r -= 1
                continue
            start = start[:idx] + start[idx+1:] + start[idx]
            r -= 1
            # print(start, end)
        return True
        
[]