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

Given two version strings, version1 and version2, compare them. A version string consists of revisions separated by dots '.'. The value of the revision is its integer conversion ignoring leading zeros.
To compare version strings, compare their revision values in left-to-right order. If one of the version strings has fewer revisions, treat the missing revision values as 0.
Return the following:

If version1 < version2, return -1.
If version1 > version2, return 1.
Otherwise, return 0.

 
Please complete the following python code precisely:
```python
class Solution:
    def compareVersion(self, version1: str, version2: str) -> int:
```