def missingBlockij(num, M, i, j):
    """Search if num is missing from the 3by3 block that contains (i, j)

    Args:
        num (int): Between 1 and 9
        M (array): sudoku
        i (int): row index
        j (int): column index

    Returns:
        bool: num is missing from the 3by3 block that contains (i, j)
    """
    parti = i - i % 3
    partj = j - j % 3
    for i in range(parti, parti + 3):
        for j in range(partj, partj + 3):
            if M[i, j] == num:
                return False
    return True