@@ -0,0 +1,711 @@
+package leetcode;%0A%0A/**%0A * https://oj.leetcode.com/problems/compare-version-numbers/%0A */%0Apublic class Problem165 %7B%0A    public int compareVersion(String version1, String version2) %7B%0A        String%5B%5D ver1 = version1.split(%22%5C%5C.%22);%0A        String%5B%5D ver2 = version2.split(%22%5C%5C.%22);%0A        %0A        for (int i = 0; i %3C Math.max(ver1.length, ver2.length); i++) %7B%0A            int v1 = (i %3E= ver1.length) ? 0 : Integer.parseInt(ver1%5Bi%5D);%0A            int v2 = (i %3E= ver2.length) ? 0 : Integer.parseInt(ver2%5Bi%5D);%0A            System.out.println(v1 + %22 %22 + v2);%0A            if (v1 %3C v2) %7B%0A                return -1;%0A            %7D else if (v1 %3E v2) %7B%0A                return 1;%0A            %7D%0A        %7D%0A        return 0;%0A    %7D%0A%7D%0A

Solve problem 165