C++ || 0ms || Simple Approach
\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        if(num==0)\n            return 0;\n        if(num>0)\n        {\n          s
```\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        if(num==0)\n            return 0;\n        if(num>0)\n        {\n          string str=to_string(num);\n            sort(str.begin(),str.end());\n            int i=0;\n            while(str[i]==\'0\')\n                i++;\n            swap(str[0],str[i]);\n            num=stoll(str);\n            \n        }\n        else\n        {\n            num=abs(num);\n            string str=to_string(num);\n            sort(str.begin(),str.end(),greater<int>());\n            num=-1*stoll(str);\n        }\n        return num;\n    }\n};\n```
['C', 'Sorting']