💥MOST EFFICENT🔥 SIMPLE & EASY METHOD 🔥
Approach\n- Convert to string and Sort digits in ascending order for positive, descending for negative.\n- Swap leading zero with the first non-zero digit for p
# Approach\n- ***Convert to string and Sort digits in ascending order for positive, descending for negative.***\n- ***Swap leading zero with the first non-zero digit for pos numbers.***\n- ***Convert sorted digits back to an integer, convert back to the original sign.***\n\n# Complexity\n- **Time**: $O(n log n)$\n- **Space**: $O(n)$\n\n\uD83D\uDCA5 UPVOTE if it helped :D ------------>\n# Code\n```python3 []\nclass Solution:\n    def smallestNumber(self, num: int) -> int:\n        digits = sorted(str(abs(num)), reverse= num < 0) # if -ve sort in reverse \n        # swap leading zeros for pos number\n        if digits[0] == \'0\':\n            for i in range(1, len(digits)):\n                if digits[i] != \'0\':\n                    digits[0], digits[i] = digits[i], \'0\'\n                    break\n\n        return int("".join(digits)) * (1 if num > 0 else -1)\n```
['Math', 'Sorting', 'C++', 'Python3']