Easy to understand Simple [C++] Faster Than 100%
class Solution {\npublic:\n    long long smallestNumber(long long num) {\n        bool flag=num>0;\n        num=abs(num);\n        if(flag){\n            string
```class Solution {\npublic:\n    long long smallestNumber(long long num) {\n        bool flag=num>0;\n        num=abs(num);\n        if(flag){\n            string s=to_string(num);\n            sort(s.begin(), s.end());\n            int i = 0;\n            while (s[i] == \'0\')\n                i++;\n            swap(s[0], s[i]);\n            num=stoll(s);\n        }\n        else{\n            string s=to_string(num);\n            sort(s.begin(), s.end(),greater<int>());\n            s=\'-\'+s;\n            num=stoll(s);\n        }\n        return num;\n    }\n};```
['C', 'Sorting']