Python | Index | O(n)
```\nfrom collections import defaultdict\nclass Solution:\n    def isTransformable(self, s: str, t: str) -> bool:\n        index = defaultdict(list)\n        fo
```\nfrom collections import defaultdict\nclass Solution:\n    def isTransformable(self, s: str, t: str) -> bool:\n        index = defaultdict(list)\n        for i, c in enumerate(s):\n            index[c].append(i)\n        curpos = defaultdict(int)\n        for c in t:\n            if curpos[c] == len(index[c]): return False\n            for i in range(int(c)):\n                i = str(i)\n                if curpos[i] < len(index[i]) and index[i][curpos[i]] < index[c][curpos[c]]:\n                    return False\n            curpos[c] += 1\n        return True
['Python']