simple just 3 Conditions (String + Sorting)
class Solution {\npublic:\n    long long smallestNumber(long long num) {\n        string s=to_string(num);\n        sort(s.begin(),s.end());\n        if(s[0]==\
class Solution {\npublic:\n    long long smallestNumber(long long num) {\n        string s=to_string(num);\n        sort(s.begin(),s.end());\n        if(s[0]==\'-\'){\n        string t="";\n            for(int i=s.size()-1;i>=0;i--){\n                t+=s[i];\n            }\n            t="-"+t;\n            long long val1=stoll(t);\n            return val1;\n            }\n        else if(s[0]==\'0\'){\n            for(int i=0;i<s.size();i++){\n                if(s[i]!=\'0\'){\n                    swap(s[0],s[i]);\n                    break;\n                }\n            }\n            long long val2=stoll(s);\n            return val2;\n        }\n        else{\n            long long val3=stoll(s);\n           return val3;\n        }\n        \n    }\n};
['String', 'C', 'Sorting']