C++ | queue
\nclass Solution {\npublic:\n    bool isTransformable(string s, string t) \n    {\n        int n=t.size();\n        vector<queue<int>>v(10);\n        for(int i=
```\nclass Solution {\npublic:\n    bool isTransformable(string s, string t) \n    {\n        int n=t.size();\n        vector<queue<int>>v(10);\n        for(int i=0;i<n;i++)\n            v[s[i]-\'0\'].push(i);\n        for(int i=0;i<n;i++)\n        {\n            int d=t[i]-\'0\';\n            if(v[d].empty())\n                return false;\n            int pos=v[d].front();\n            v[d].pop();\n            for(int j=0;j<d;j++)\n            {\n                if(!v[j].empty() && v[j].front()<pos)\n                    return false;\n            }\n        }\n        return true;\n    }\n};\n```
[]