@@ -0,0 +1,916 @@
+package leetcode.compare_version_numbers;%0A%0Apublic class Solution %7B%0A    public int compareVersion(String version1, String version2) %7B%0A    %09version1 = version1.replaceAll(%22(%5C%5C.0+)+$%22, %22%22);%0A    %09version2 = version2.replaceAll(%22(%5C%5C.0+)+$%22, %22%22);%0A        String%5B%5D sp1 = version1.split(%22%5C%5C.%22);%0A        String%5B%5D sp2 = version2.split(%22%5C%5C.%22);%0A        int l1 = sp1.length;%0A        int l2 = sp2.length;%0A        int l = Math.min(l1, l2);%0A        for(int i = 0; i %3C l; i++)%7B%0A        %09String n1 = sp1%5Bi%5D.replaceAll(%22%5E0+%22, %22%22);%0A        %09String n2 = sp2%5Bi%5D.replaceAll(%22%5E0+%22, %22%22);%0A        %09if(n1.length() %3E n2.length())%7B%0A        %09%09return 1;%0A        %09%7Delse if(n1.length() %3C n2.length())%7B%0A        %09%09return -1;%0A        %09%7Delse%7B%0A        %09%09int cmp = n1.compareTo(n2);%0A        %09%09if(cmp %3E 0) return 1;%0A        %09%09if(cmp %3C 0) return -1;%0A        %09%7D%0A        %7D%0A        if(l1 %3E l2) return 1;%0A        if(l1 %3C l2) return -1;%0A        return 0;%0A    %7D%0A%7D

Add java solution for 165. Compare Version Numbers