Queue | C++ | 💨 Fast & 👌 Simple!
\nclass Solution {\npublic:\n    bool canChange(string s, string t) {\n        queue<pair<char, int>> ss, ts;\n        \n        // Fill queue with start\n     
```\nclass Solution {\npublic:\n    bool canChange(string s, string t) {\n        queue<pair<char, int>> ss, ts;\n        \n        // Fill queue with start\n        for(int i=0; i<s.size(); i++){\n            if(s[i] != \'_\')ss.push({s[i], i});        \n        }\n        \n        // Fill queue with target\n        for(int i=0; i<t.size(); i++){\n            if(t[i] != \'_\')ts.push({t[i], i});\n        }\n\n        if(ss.size() != ts.size())return false;\n        \n        while(ss.size()){\n            pair<char, int> sp, tp;\n            \n            sp = ss.front();\n            tp = ts.front();\n            \n            ss.pop();\n            ts.pop();\n            \n//             If both the letters don;t match return false, or check for the index to move Left and Right\n            if(sp.first != tp.first) return false;\n            if(sp.first == \'L\' && tp.second>sp.second){\n                return false;\n            } else if(sp.first == \'R\' && tp.second<sp.second){\n                return false;\n            }\n        }\n        \n        return true;\n    }\n};\n```
['Queue']