Hashtable python3 beating 96%
First check corner cases where s and t are equal or they are not anagrams\n\nthey create 10 queues for the indices each digit appears in s\n\ntraverse t, we alw
First check corner cases where s and t are equal or they are not anagrams\n\nthey create 10 queues for the indices each digit appears in s\n\ntraverse t, we always want the foremost t[i] present in s to be swapped forward in a pairwise manner. So there cannot be any digit smaller than it before it. We keep 10 indices for the foremost availible digits from 0-9, and check the smaller digits to see whether their foremost elements are before the one we want. if yes, return False\n\nreturn True if the loop ended normally\n\n# Code\n```\nclass Solution:\n    def isTransformable(self, s: str, t: str) -> bool: \n        if s==t:return True       \n        C1 = Counter(s)\n        C2 = Counter(t)\n        for i in range(10):\n            if C1[str(i)]!=C2[str(i)]:return False\n        \n        n = len(s)\n        queues = [[] for i in range(10)]\n        inds = [0 for i in range(10)]\n        for i,a in enumerate(s):\n            queues[int(a)].append(i)\n        \n        for i,a in enumerate(t):\n            for b in range(int(a)):\n                if inds[b] < len(queues[b]) and queues[b][inds[b]]<queues[int(a)][inds[int(a)]]:return False\n            inds[int(a)] += 1\n        return True\n\n\n\n\n        \n```
['Hash Table', 'Python3']