def get_minor_matrix(q, i, j):
    """
    Q = [
        [1,2,3],
        [4,5,6],
        [7,8,9],
    ]
    Minor matrix corresponding to 0,0 is
    [
        [5,6],
        [8,9],
    ]
    """

    minor_matrix = []
    for row in q[:i] + q[i + 1:]:
        temp = []
        for item in row[:j] + row[j + 1:]:
            temp.append(item)
        minor_matrix.append(temp)
    return minor_matrix