BEATS 99.85% O(n) using memorization
```\nbool isTransformable(string s, string t) {\n        vector arr[10];\n        for(int i=0;i=0;i--)\n        {\n            while(s[ct]==\'-\'&&ct>=0)\n     
```\nbool isTransformable(string s, string t) {\n        vector<int> arr[10];\n        for(int i=0;i<s.length();i++)\n        {\n            arr[s[i]-\'0\'].push_back(i);\n        }\n        int ct=s.length()-1;\n        for(int i=t.length()-1;i>=0;i--)\n        {\n            while(s[ct]==\'-\'&&ct>=0)\n                ct--;\n            if(ct<0)\n                return false;\n            if(s[ct]<t[i])\n            {\n                if(arr[t[i]-\'0\'].size()!=0)\n                {\n                    for(int j=t[i]-\'0\'+1;j<=9;j++)\n                    {\n                        if(arr[j].size()!=0&&arr[j][arr[j].size()-1]>arr[t[i]-\'0\'][arr[t[i]-\'0\'].size()-1])\n                            return false;\n                    }\n                    s[arr[t[i]-\'0\'][arr[t[i]-\'0\'].size()-1]]=\'-\';\n                    arr[t[i]-\'0\'].pop_back();\n                }\n                else\n                    return false;\n                \n            }\n            else if(s[ct]>t[i])\n            {\n                return false;\n            }\n            else\n            {\n                arr[t[i]-\'0\'].pop_back();\n                ct--;\n            }\n            //cout<<s<<" ";\n        }\n        return true;\n    }
[]