Clean C++ Code | Easy to understand
If number is negative , sort and just reverse. \nAnd If number is positive, sort and check if first character is \'0\' then flip it with first non-negative.\n\n
If number is `negative` , sort and just reverse. \nAnd If number is `positive`, sort and check if first character is \'0\' then flip it with first non-negative.\n\n```  \nclass Solution {\npublic:\n  \n    #define ll long long;\n    \n    long long smallestNumber(long long num) {\n        \n        string str = to_string(num);\n        sort(str.begin(), str.end());\n        \n        if(num < 0){\n            reverse(str.begin(), str.end());      \n            return -stoll(str); \n        }\n        \n        \n        if(str[0] == \'0\'){\n            for(int i = 0; i < str.size(); i++){\n                if(str[i] > \'0\'){\n                    str[0] = str[i];\n                    str[i] = \'0\';\n                    break;\n                }\n            }\n        }\n        \n        return stoll(str); \n    }\n};
[]