@@ -0,0 +1,880 @@
+package problems;%0A%0Apublic class CompareVersionNumbers %7B%0A    public int compareVersion(String version1, String version2) %7B%0A        if (version1 == null %7C%7C version2 == null)%0A            return 0;%0A        %0A        String%5B%5D v1 = version1.split(%22%5C%5C.%22);%0A        String%5B%5D v2 = version2.split(%22%5C%5C.%22);%0A        int n1 = v1.length, n2 = v2.length;%0A        %0A        for (int i = 0; i %3C n1 %7C%7C i %3C n2; i++) %7B%0A            int t1 = i %3C n1 ? Integer.parseInt(v1%5Bi%5D) : 0;%0A            int t2 = i %3C n2 ? Integer.parseInt(v2%5Bi%5D) : 0;%0A            if (t1 %3E t2)%0A                return 1;%0A            if (t1 %3C t2)%0A                return -1;%0A        %7D%0A        return 0;%0A    %7D%0A    %0A    public static void main (String%5B%5D args) %7B%0A        CompareVersionNumbers cv = new CompareVersionNumbers();%0A        String v1 = %221.0%22;%0A        String v2 = %221%22;%0A        System.out.println(cv.compareVersion(v1, v2));%0A    %7D%0A%7D%0A

Add Compare Version Numbers