Simple Java | O(n) solution | Clean code | Better than 100% code submissions
\n    public boolean isTransformable(String s, String t) {\n        int i, j, limit;\n        ArrayList<LinkedList<Integer>> flags = new ArrayList<>();\n       
```\n    public boolean isTransformable(String s, String t) {\n        int i, j, limit;\n        ArrayList<LinkedList<Integer>> flags = new ArrayList<>();\n        for (i = 0; i < 10; ++i) {\n            flags.add(new LinkedList<>());\n        }\n        for (i = 0; i < s.length(); ++i) {\n            flags.get(s.charAt(i) - \'0\').add(i);\n        }\n        for (i = 0; i < t.length(); ++i) {\n            limit = t.charAt(i) - \'0\';\n            if (flags.get(limit).isEmpty()) {\n                return false;\n            }\n            for (j = 0; j < limit; ++j) {\n                if (!flags.get(j).isEmpty() && flags.get(j).get(0) < flags.get(limit).get(0)) {\n                    return false;\n                }\n            }\n            flags.get(limit).remove();\n        }\n        return true;\n    }\n\t```
[]