[Python] O(nlogn) commented but kinda long :/
\nclass Solution:\n    def isTransformable(self, s: str, t: str) -> bool:\n        \n        #Dictionary with char indexes\n        d1, d2 = [[] for _ in range(
```\nclass Solution:\n    def isTransformable(self, s: str, t: str) -> bool:\n        \n        #Dictionary with char indexes\n        d1, d2 = [[] for _ in range(10)],[[] for _ in range(10)]\n        sel = [str(chr(i+48)) for i in range(10) ]\n        \n        #Build the dicts\n        for i,x in enumerate(s):\n            d1[ord(x)-48].append(i)\n        for i,x in enumerate(t):\n            d2[ord(x)-48].append(i)\n        \n        #Check char count\n        for i in range(10):\n            if len(d1[i]) != len(d2[i]): \n                return False\n        \n        i, j = 0,0\n        s,t = list(s), list(t)\n        \n        #Match chars b/w src and dest\n        while i<len(t) and j<len(s):\n\n            \n            #if equal, move forward\n            if t[i] == s[j]:\n                i += 1\n                j += 1\n            #if char in src used, move forward in src\n            elif s[j] == None:\n                j += 1\n            else:\n                #find first occ of required char\n                f = bisect.bisect_left(d1[ord(t[i])-48],j)\n                \n                #check if index valid\n                if f == len(d1[ord(t[i])-48]): \n                    print("bin")\n                    return False\n                #check if any char smaller than req char is in range between\n                #current index and required index of char\n                for k in range(0,sel.index(t[i])):\n                    #print("checking")\n                    pr = bisect.bisect_left(d1[k],j)\n                    if pr<len(d1[k]) and d1[k][pr] < d1[ord(t[i])-48][f]: return False\n                #Consume char we just used\n                s[d1[ord(t[i])-48][f]] = None\n                #Remove consumed char from dict\n                d1[ord(t[i])-48].pop(f)\n                i += 1\n        return True\n```
[]