<doocs>0165.Compare Version Numbers_1.py
def compareVersion( version1: str, version2: str) -> int:
    i, j, m, n = 0, 0, len(version1), len(version2)
    while i < m or j < n:
        a = b = 0
        while i < m and version1[i] != '.':
            a = a * 10 + int(version1[i])
            i += 1
        while j < n and version2[j] != '.':
            b = b * 10 + int(version2[j])
            j += 1
        if a != b:
            return -1 if a < b else 1
        i += 1
        j += 1
    return 0
def sample_funcname ( var_0 : str , var_2 : str ) -> int :
    var_5 , var_6 , var_8 , var_9 = 0 , 0 , len ( var_0 ) , len ( var_2 )
    while var_5 < var_8 or var_6 < var_9 :
        var_11 = var_10 = 0
        while var_5 < var_8 and var_0 [ var_5 ] != '.' :
            var_11 = var_11 * 10 + int ( var_0 [ var_5 ] )
            var_5 += 1
        while var_6 < var_9 and var_2 [ var_6 ] != '.' :
            var_10 = var_10 * 10 + int ( var_2 [ var_6 ] )
            var_6 += 1
        if var_11 != var_10 :
            return - 1 if var_11 < var_10 else 1
        var_5 += 1
        var_6 += 1
    return 0
