With deques, beats 98% time, 96 space (not sure why though)
Intuition\nPb can be nicely reduced to: \'for each digit of t, check if its first occurence in s is only preceded by bigger numbers\'\n Describe your first thou
# Intuition\nPb can be nicely reduced to: \'for each digit of t, check if its first occurence in s is only preceded by bigger numbers\'\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nWe keep track of the the order of appearance in s via a collection of deque representing the ascending list of indices for each digit [0, ..., 9]. Then we consider each digit of t, pop the smallest corresponding index of s, and check that there are no smaller number before by checking first element of the corresponding deques\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\nO(2n) = O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n O(n) too\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def isTransformable(self, s: str, t: str) -> bool:\n        if s == t:\n            return True\n        big_table = [deque() for _ in range(10)]\n        for i, c in enumerate(s):\n            big_table[int(c)].append(i)\n        \n        for c in t:\n            if not big_table[int(c)]: return False\n            i = big_table[int(c)].popleft()\n            for j in range(int(c)):\n                if big_table[j] and big_table[j][0] < i:\n                    return False\n        return True\n\n\n\n```
['Python3']