def find_finished_idxs(pattern_matrix):
    """
    Find indexs that cannot be eliminated further
    """
    rm_idxs = set(range(len(pattern_matrix)))
    for i, row in enumerate(pattern_matrix):
        if (row[2] < 0 or row[2] > 1) and i in rm_idxs:
            rm_idxs.remove(i)
    for i, row in enumerate(pattern_matrix):
        for rowidx in [0, 1]:
            for j in [j for j in rm_idxs if i < j]:
                x = row[rowidx][j - i - 1]
                if x > 1:
                    rm_idxs.remove(j)
    return rm_idxs
