def num_in_box(board, row, col, num):
    """
    row and col should be the top-left coordinates of the box
    True if num is already in the 3x3 box, False otherwise
    """
    return num in [board[row+i][col+j] for i in range(3) for j in range(3)]