private static boolean isValidMove(int x, int y, int[][] board, int number) {
        //check if the row or column contains the same number
        for( int i=0; i< n; i++) {
            if(board[x][i] == number || board[i][y] ==number) {
                return false;
            }
        }

        // we want to find the left Top coordinates of the box in which the current x,y element is
        // since there cannot be duplicate element in the box
        // very cool trick  -   x - x%sqrt(n) - > leftTopX
        int boxDimension = new Double(Math.sqrt(n)).intValue();
        int xleftTop = x - (x % boxDimension);
        // same trick  - y - y%sqrt(n)  - > yTopLeft
        int yleftTop = y - (y % boxDimension);

        // fromt left top to right bottom .. check in the box
        for( int i = xleftTop; i < xleftTop + boxDimension; i++) {
            for(int j= yleftTop; j < yleftTop + boxDimension; j++) {
                if(board[i][j] == number) {
                    return false;
                }
            }
        }

        return true;
    }