Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given an integer num. Rearrange the digits of num such that its value is minimized and it does not contain any leading zeros.
Return the rearranged number with minimal value.
Note that the sign of the number does not change after rearranging the digits.
 
Please complete the following python code precisely:
```python
class Solution:
    def smallestNumber(self, num: int) -> int:
```