C++ || TC: O(n)  || Stack Solution || Greedy
```\nclass Solution {\npublic:\n    bool canChange(string a, string b) {\n        if(a.size()!=b.size())\n        {\n            return false;\n        }\n     
```\nclass Solution {\npublic:\n    bool canChange(string a, string b) {\n        if(a.size()!=b.size())\n        {\n            return false;\n        }\n        \n        stack<pair<char,int>> st;\n        int n=a.size();\n        for(int i=0;i<n;i++)\n        {\n            if(b[i]!=\'_\')\n            {\n                st.push({b[i],i});\n            }\n          \n        }\n        \n        for(int i=n-1;i>=0;i--)\n        {\n            \n            \n            if(a[i]!=\'_\')\n            {\n                if(st.size()==0)\n                {\n                    return false;\n                }\n               auto curr=st.top();\n               char x=curr.first;\n               int y=curr.second;\n                if(x!=a[i])\n                {\n                    return false;\n                }\n                \n               if(x==\'R\' and x==a[i])\n               {\n                   if(i<=y)\n                   {\n                        st.pop();\n                     \n                   }\n                   else\n                   {\n                        return false;\n                   }\n               }\n\n               if(x==\'L\' and x==a[i])\n               {\n                   if(i>=y)\n                   {\n                       st.pop();\n                     \n                   }\n                   else\n                   {\n                         return false;\n                   }\n               }\n            }\n        }\n        if(st.size()==0)\n        {\n            return true;\n        }\n        return false;\n        \n    }\n};
['Stack', 'Greedy', 'C']