without 2 pointer simple loop logic and counting
\n\n# Code\ncpp []\nclass Solution {\npublic:\n    bool canChange(string start, string target) {\n        if(start.size()!=target.size()) return false;\n       
\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    bool canChange(string start, string target) {\n        if(start.size()!=target.size()) return false;\n        int sl=0,sr=0,tl=0,tr=0;\n        for(int i=start.size()-1;i>=0;i--){\n        if(start[i]==\'L\') sl++;\n        else if(start[i]==\'R\') sr++;\n        if(target[i]==\'L\') tl++;\n        else if(target[i]==\'R\') tr++;\n        if (sl<tl || sr>tr) return false;\n        if (((start[i]==\'L\'||target[i]==\'L\')&&sr!=tr) || ((start[i]==\'R\'||target[i]==\'R\')&&sl!=tl)) return false;\n        }\n        if(sr!=tr || tl!=sl) return false;\n        return true;\n    }\n};\n\n```
['String', 'C++']