[Python3] O(N) with detailed explanation
Observations:\n - Operation on N-length substring (sorting) can be represented as seria of operations on 2-length substring (kind of bubble sort). Operation on 
Observations:\n - Operation on N-length substring (sorting) can be represented as seria of operations on 2-length substring (kind of bubble sort). Operation on 2-length string is swap two adjecent digits if they are not ordered. So the problem is: can we apply seria of swaps to transform \'s\' to \'t\'?\n\n - How to apply operations:\n   \n   For each digit D in "t":\n        Find the first occurrence of D in "s", but if during iterating through "s" we find digit less than D then return False because swaping won\'t be possible.\n        For example:\n            s = "84532" and t = "34852"\n            D = 3, all digits in s before 3 are greater, so we can make swapping:\n                "84532" -> "84352" -> "83452" -> "38452"\n            And continue with "s" = "4532" and "t" = "8452"\n            If "s" would be "84132" and "t" = "34852", we wouldn\'t be able to swap 3 with 1.\n\n```python\nclass Solution:\n    def isTransformable(self, s: str, t: str) -> bool:\n        # to make solution faster build array with occurrences of each digit\n        digit_indexes = [deque() for _ in range(10)]\n        for i in range(len(s)):\n            digit_indexes[int(s[i])].append(i)\n\n        for x in t:\n            digit = int(x)\n\n            # if there is needed digit in s\n            if len(digit_indexes[digit]) > 0:\n                # then find its first occurrence\n                swap_index = digit_indexes[digit].popleft()\n                \n                # and check if there are no occurrences of smaller digits before it\n                for k in range(0, digit):\n                    if len(digit_indexes[k]) > 0 and digit_indexes[k][0] < swap_index:\n                        return False\n            else:\n                return False\n            \n        return True\n                            \n\n```
[]