copied from Vlad, similar to permutation problem
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    long long smallestNumber(long long num) {
        // copied shorthand from vlad

        // sort 
        // if -ve, decresing order
        // +ve increasing order
        // find first 0, replace with first number

        auto s = to_string(abs(num));

        // shorthand sorting amazing
        sort(begin(s),end(s),[&](int a,int b){
            return num < 0 ? a > b: a < b;
        });


        // find_first_not_of I mean amazing, saves 
        // us from writing useless for loop
        if(num>0){
            swap(s[0],s[s.find_first_not_of('0')]);
        }

        // stoll : s[i]*10(of current position)
        return stoll(s) * (num <0 ?-1:1);
        
    }
};
```
['C++']