Short Python beats 100%
The idea is simple: smaller digits can not cross bigger digits to go to the right when re arranging the numbers:\n\n\nIn the left side there are two crossings 3
The idea is simple: smaller digits can not cross bigger digits to go to the right when re arranging the numbers:\n![image](https://assets.leetcode.com/users/images/45b2a240-ec97-4229-8ac6-7c55b2346385_1600040702.5582404.png)\n\nIn the left side there are two crossings 3 crosses 5 and 8 which is ok but on the right example 3 is crossing 4 to go to the right.\n\nWe can track these crossings with an array of size 10 which indicates which digits(and how many of them) are going right (+) and which digits are going left(-) and at each step we check that there is no negative after positive numbers (ie. no smaller number is going right (a larger number crossing a smaller number to go to the left)\n\nNote that the code passes all current tests wihtout the first line (checking Counters) but it fail for "2"->"1" which should be added as a test\n```\ndef isTransformable(self, s: str, t: str) -> bool:\n        if Counter(s)!=Counter(t):return False\n        crossings=[0]*10\n        for i in range(len(s)):\n            if s[i]!=t[i]:\n                crossings[int(s[i])]+=1\n                crossings[int(t[i])]-=1\n                pos = False\n                for j in range(10):\n                    if crossings[j]>0: pos = True\n                    if pos and crossings[j]<0: return False\n        return True\n```
[]