<doocs>2306.Naming a Company_1.py
def distinctNames( ideas: List[str]) -> int:
    s = set(ideas)
    f = [[0] * 26 for _ in range(26)]
    for v in ideas:
        i = ord(v[0]) - ord('a')
        t = list(v)
        for j in range(26):
            t[0] = chr(ord('a') + j)
            if ''.join(t) not in s:
                f[i][j] += 1
    ans = 0
    for v in ideas:
        i = ord(v[0]) - ord('a')
        t = list(v)
        for j in range(26):
            t[0] = chr(ord('a') + j)
            if ''.join(t) not in s:
                ans += f[j][i]
    return ans
def sample_funcname ( var_0 : List [ str ] ) -> int :
    var_5 = set ( var_0 )
    var_10 = [ [ 0 ] * 26 for var_8 in range ( 26 ) ]
    for var_11 in var_0 :
        var_14 = ord ( var_11 [ 0 ] ) - ord ( 'a' )
        var_16 = list ( var_11 )
        for var_17 in range ( 26 ) :
            var_16 [ 0 ] = chr ( ord ( 'a' ) + var_17 )
            if ''.join ( var_16 ) not in var_5 :
                var_10 [ var_14 ] [ var_17 ] += 1
    var_22 = 0
    for var_11 in var_0 :
        var_14 = ord ( var_11 [ 0 ] ) - ord ( 'a' )
        var_16 = list ( var_11 )
        for var_17 in range ( 26 ) :
            var_16 [ 0 ] = chr ( ord ( 'a' ) + var_17 )
            if ''.join ( var_16 ) not in var_5 :
                var_22 += var_10 [ var_17 ] [ var_14 ]
    return var_22
