C++ || convert to string
\nclass Solution {\npublic:\n    int minMaxDifference(int num) {\n        string s = to_string(num);\n        string x=s;\n        int i=0;\n        while(i<x.s
```\nclass Solution {\npublic:\n    int minMaxDifference(int num) {\n        string s = to_string(num);\n        string x=s;\n        int i=0;\n        while(i<x.size() && x[i]==\'9\'){\n                i++;\n        }\n        char a= i<x.size()?s[i]:\'.\';\n        if(a==\'.\') return stoi(x);\n        for(;i<x.size();i++){\n            if(x[i]==a) x[i] = \'9\';\n        }\n        string xx=s;\n        int j=0;\n        while(j<xx.size() && xx[j]==\'0\'){\n            j++;\n        }\n        char b = j<xx.size()?xx[j]:\'.\';\n        if(b==\'.\'){\n            string ans="";\n            for(int m=0;m<s.size();m++) ans+=\'9\';\n            return stoi(ans);\n        }\n        for(;j<xx.size();j++){\n            if(xx[j]==b){\n                xx[j] = \'0\';\n            }\n        }\n        return stoi(x)-stoi(xx);\n    }\n};\n```
['C', 'C++']