C++ || Sort , Reverse (if negative) and Swap
\nclass Solution {\npublic:\n    long long smallestNumber(long long num) \n    {\n        \n        if(!num) return num; \n        \n        int sign = (num>0)?
```\nclass Solution {\npublic:\n    long long smallestNumber(long long num) \n    {\n        \n        if(!num) return num; \n        \n        int sign = (num>0)? 1 : -1;\n        \n        string s = to_string(abs(num));\n        \n        sort(s.begin(), s.end());\n            \n        if(sign==-1)\n        {\n            reverse(s.begin(), s.end());\n        }\n                \n        int j=0;\n        \n        while(s[j]==\'0\')\n        {\n            j++;\n        }\n        \n        swap(s[0],s[j]);\n        \n        return sign * stol(s);\n    }\n};\n```
['String', 'C', 'Sorting', 'C++']