Java place digit by digit O(10N)
```\nclass Solution {\n    public boolean isTransformable(String s, String t) {\n        int len = s.length(), l = 0;\n        int[] next = new int[10];\n      
```\nclass Solution {\n    public boolean isTransformable(String s, String t) {\n        int len = s.length(), l = 0;\n        int[] next = new int[10];\n        for(int i = 0; i < 10; i++) {\n            next[i] = len;\n        }\n        for(int i = 0; i < 10; i++) {\n            for(int j = 0; j < len; j++) {\n                if(s.charAt(j) - \'0\' == i) {\n                    next[i] = j; break;\n                }\n            }\n        }\n        while(l < len) {\n            int tIdx = t.charAt(l) - \'0\';\n            int find = next[tIdx];\n            if(find >= len) return false;\n            for(int i = 0; i < tIdx; i++) {\n                if(next[i] < find) return false;\n            }\n            next[tIdx] = len;\n            for(int i = find + 1; i < len; i++) {\n                if(s.charAt(i) - \'0\' == tIdx) {\n                    next[tIdx] = i;\n                    break;\n                }\n            }\n            l++;\n        }\n        return true;\n    }\n}
[]