C++ O(N) 99% extremely simple code
Sort one type of digit at a time, from \'0\' up to \'9\'.\n\nCount the number of the digit in s and t, return false when s contains more digits than t.\n\nExamp
Sort one type of digit at a time, from \'0\' up to \'9\'.\n\nCount the number of the digit in s and t, return false when s contains more digits than t.\n\nExample:\nIt\'s impossible to do this conversion by swapping digits.\ns: 11xx\nt: 1xx1\n\n```\nclass Solution {\npublic:\n    bool isTransformable(string s, string t, char c = \'0\') {\n        if (c > \'9\')\n            return true;\n        string ss, tt;\n        int n = s.size();\n        for (int i = 0, scnt = 0, tcnt = 0; i < n; ++i) {\n            if (s[i] == c)\n                ++scnt;\n            else\n                ss.push_back(s[i]);\n            if (t[i] == c)\n                ++tcnt;\n            else\n                tt.push_back(t[i]);\n            if (scnt > tcnt)\n                return false;\n        }\n        return isTransformable(ss, tt, c + 1);\n    }\n};\n```
[]