my cpp solution
\nclass Solution {\npublic:\nbool isTransformable(string s, string t) {\n    bool ans = false;\n    vector<vector<int>> vec(10, vector<int>());\n    int n = s.l
```\nclass Solution {\npublic:\nbool isTransformable(string s, string t) {\n    bool ans = false;\n    vector<vector<int>> vec(10, vector<int>());\n    int n = s.length();\n    for (int i = 0; i < n; ++i) {\n        vec[s[i] - \'0\'].push_back(i);\n    }\n    //idx \u6307\u5B9Avec\u4E2D\u7684\u7B2C\u51E0\u4E2A\n    vector<int> idx(10, 0);\n    for (int i = 0; i < 10; ++i) {\n        if (vec[i].empty()) idx[i] = -1;\n    }\n    for (int i = 0; i < n; ++i) {\n        int val = t[i]-\'0\';\n        int max_idx = idx[val];\n        if (max_idx == -1) return false;\n        for (int j = 0; j < val; ++j) {\n            if (idx[j] != -1 && vec[j][idx[j]] < vec[val][max_idx]) {\n                return false;\n            }\n        }\n        idx[val] = (idx[val] < vec[val].size()-1 ? idx[val] + 1 : -1);\n    }\n    return true;\n}\n};\n```
[]