Easy C++ Submission || Beats 100% Time Complexity
Code\n\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        long long ans = 0;\n        vector <int> v;\n        if(num==0)\n     
# Code\n```\nclass Solution {\npublic:\n    long long smallestNumber(long long num) {\n        long long ans = 0;\n        vector <int> v;\n        if(num==0)\n        {\n            return 0;\n        }\n        while(num!=0)\n        {\n            v.push_back(num%10);\n            num=num/10;\n        }\n\n        sort(v.begin(),v.end());\n        int n = v.size();\n        int s=0;\n        for(int i=0;i<n;i++)\n        {\n            if((v[0]==0) && (v[i]!=0))\n            {\n                s=i;\n                break;\n            }\n        }\n        swap(v[0],v[s]);\n        for(int i=n-1;i>=0;i--)\n        {\n            ans = ans + v[i]*pow(10,n-i-1);\n        }\n        return ans;    \n    }\n};\n```
['Sorting', 'C++']