<qiyuangong>1337_The_K_Weakest_Rows_in_a_Matrix_1.py
def kWeakestRows( mat, k):
    res = []
    num_row = len(mat)
    num_col = len(mat[0])
    col = 0
    flag = 1
    while col < num_col and flag:
        for i in range(num_row):
            if i in res:
                continue
            if mat[i][col] == 0:
                res.append(i)
            if len(res) == k:
                flag = 0
                break
        col += 1
    if len(res) == k:
        return res
    for i in range(num_row):
        if i in res:
            continue
        res.append(i)
        if len(res) == k:
            break
    return res
def sample_funcname ( var_0 , var_1 ) :
    var_2 = [ ]
    var_4 = len ( var_0 )
    var_6 = len ( var_0 [ 0 ] )
    var_7 = 0
    var_9 = 1
    while var_7 < var_6 and var_9 :
        for var_11 in range ( var_4 ) :
            if var_11 in var_2 :
                continue
            if var_0 [ var_11 ] [ var_7 ] == 0 :
                var_2.append ( var_11 )
            if len ( var_2 ) == var_1 :
                var_9 = 0
                break
        var_7 += 1
    if len ( var_2 ) == var_1 :
        return var_2
    for var_11 in range ( var_4 ) :
        if var_11 in var_2 :
            continue
        var_2.append ( var_11 )
        if len ( var_2 ) == var_1 :
            break
    return var_2
