JAVA O(n) solution
\nclass Solution {\n    public boolean isTransformable(String s, String t) {\n        int n = s.length();\n        ArrayList<Integer> arr[] = new ArrayList[10];
```\nclass Solution {\n    public boolean isTransformable(String s, String t) {\n        int n = s.length();\n        ArrayList<Integer> arr[] = new ArrayList[10];\n        for(int i=0 ; i<10 ; i++){\n          arr[i] = new ArrayList<>();\n        }\n        for(int i=0 ; i<s.length() ; i++){\n           arr[s.charAt(i) - \'0\'].add(i);\n        }\n        int limit = 0;\n        for(int i=0 ; i<t.length() ; i++){\n           limit = t.charAt(i) - \'0\';\n           if(arr[limit].size() == 0){\n             return false;\n           }\n           for(int j=0 ; j<limit ; j++){\n             if(arr[j].size()!=0 && arr[j].get(0) < arr[limit].get(0)){\n               return false;\n             }\n           }\n           arr[limit].remove(0);\n        } \n        \n       return true;\n          \n    }\n    }\n```\n
[]