[C++], beats 100%, Greedy O(N), with comments
\nclass Solution {\npublic:\n    vector<int> occur[10];            // occur[i] -> stores indices where s[index] == i\n    unordered_set<int> usedIndex;      // 
```\nclass Solution {\npublic:\n    vector<int> occur[10];            // occur[i] -> stores indices where s[index] == i\n    unordered_set<int> usedIndex;      // used indices of s\n    \n    bool isTransformable(string s, string t) {\n        vector<int> idx(10, 0);                 // idx[i] -> current(under consideration) index of val i in occur[i]\n        \n        int chars1[10] = {0}, chars2[10] = {0};      // #digitOccurrences in s and t \n        for(auto c: s) chars1[c - \'0\']++;\n        for(auto c: t) chars2[c - \'0\']++;\n        for(int i=0; i<10; i++) if(chars1[i] != chars2[i])   // unequal occurrences of that digit\n            return false;\n        \n        int d, n = s.length();\n        for(int i=0; i<n; i++) {\n            d = (s[i] - \'0\');\n            occur[d].push_back(i);\n        }\n        \n        int i = 0, j = 0;\n        while(j < n) {                                          // trying to match each char of t with some char in s\n            while(usedIndex.find(i) != usedIndex.end()) i++;    // already used in s\n            \n            int d1 = (s[i] - \'0\'), d2 = (t[j] - \'0\');\n            \n            if(d1 == d2) {\n                i++;                                 // no need to insert it in "usedChars", coz we won\'t be referencing it\n                j++;\n                idx[d1]++;\n                chars1[d1]--;   chars2[d2]--;\n            }\n            else {\n/*\n    we need to move this d2 in s, to the current position to match with d2 of t, to bring it here,\n    there must not be any digit, which is smaller than d2, present in between the current index and digitIndex\n    \n    if there is no such digit in between , we can bring that digit d2 to current position by swapping adjacent elements\n*/\n                int digitIndex = occur[d2][idx[d2]];    // closest index of d2 in s\n                for(int dig=0; dig<d2; dig++) {\n                    if(!chars1[dig]) continue;          // dig not present anymore\n                    \n                    if(occur[dig][idx[dig]] < digitIndex)   // not possible to bring d2 to current position\n                        return false;\n                }\n                \n                usedIndex.insert(digitIndex);\n                idx[d2]++;\n                j++;\n                chars1[d2]--;   chars2[d2]--;\n            }\n        }\n        \n        return true;\n    }\n};\n```
[]