Simple N Complexity two Pointer solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    bool canTransform(string start, string end) {\n        string withOutXS = "", withOutXE = "";\n        for(int i=0;i<start.size();i++) {\n            if(start[i] !=\'X\') {\n                withOutXS += start[i];\n            }\n            if(end[i] != \'X\') {\n                withOutXE += end[i];\n            }\n        }\n        if(withOutXS != withOutXE) {\n            return false;\n        }\n\n        int startI = 0, endI = 0;\n        int upX = 0, lowX = 0;\n        while(startI<start.size() && endI<end.size()) {\n            \n            if(start[startI]==\'X\' && lowX) {\n                startI++; lowX--;\n            } else if(end[endI]==\'X\' && upX) {\n                endI++; upX--;\n            } else if(start[startI]==end[endI]) {\n                startI++;\n                endI++;\n            } else if(start[startI]==\'R\' && end[endI]==\'X\') {\n                endI++;\n                lowX++;\n            } else if(start[startI]==\'X\' && end[endI]==\'L\') {\n                startI++; upX++;\n            } else {\n                return false;\n            }\n        }\n\n        while(startI<start.size() && lowX) {\n            if(start[startI]!=\'X\') {\n                return false;\n            }\n            lowX--;\n        }\n\n        while(endI<end.size() && upX) {\n            if(end[endI]!=\'X\') {\n                return false;\n            }\n            upX--;\n        }\n        if(upX>0 || lowX>0) {\n            return false;\n        }\n\n        return true;\n    }\n};\n\n/*\n    RX - XR\n    XL - LX\n\n    RLX\n    XRL\n\n    X can Move left if R there.\n    X can Move right if L there.\n*/\n```
['C++']