C++ || EASY TO UNDERSTAND || Simple Solution
\nclass Solution {\npublic:\n    bool canChange(string s, string t) {\n        int n=s.size();\n        string s1,s2;\n        s1=s2="";\n        vector<int> v1
```\nclass Solution {\npublic:\n    bool canChange(string s, string t) {\n        int n=s.size();\n        string s1,s2;\n        s1=s2="";\n        vector<int> v1,v2;\n        for(int i=0;i<n;i++)\n        {\n            char ch=s[i];\n            if(ch==\'L\'||ch==\'R\')\n            {\n                v1.push_back(i);\n                s1+=ch;\n            }\n        }\n        for(int i=0;i<n;i++)\n        {\n            char ch=t[i];\n            if(ch==\'L\'||ch==\'R\')\n            {\n                v2.push_back(i);\n                s2+=ch;\n            }\n        }\n        if(s1!=s2)\n        return false;\n        for(int i=0;i<v1.size();i++)\n        {\n            if(s[v1[i]]==\'L\')\n            {\n                if(v1[i]<v2[i])\n                return false;\n            }\n            else\n            {\n                if(v1[i]>v2[i])\n                return false;\n            }\n        }\n        return true;\n    }\n};\n```\n**Please upvote to motivate me in my quest of documenting all leetcode solutions. HAPPY CODING:)\nAny suggestions and improvements are always welcome**\n
[]