 All Problems
Compare Version Numbers
medium
strings
two pointers
amazon
microsoft
google

Given two version strings version1 and version2, compare them. Return -1 if version1 < version2, 1 if version1 > version2, and 0 if equal. Each version is a series of revisions separated by dots.

Example 1:

Input:
1.2
1.10
Output: -1

Example 2:

Input:
1.01
1.001
Output: 0

Input format: Line 1: version1. Line 2: version2.

Output format: -1, 0, or 1.

Run to check your code against the sample cases, or submit to run every case