app/src/main/java/sudoku/Solver.java
public boolean isValid(int r, int c, int nbr) {
        assertIsWithinBounds(r, c, nbr);
        int oldNbr = getNumber(r, c); 
        setOrClearNumber(r, c, nbr);
        boolean isValid = isValid(r, c);
        setOrClearNumber(r, c, oldNbr);  
        return isValid;
    }
/**
     * Check sudoku rules for row r, column c after trying to set nbr.
     * 
     * Bounds are checked with assertIsWithinBounds.
     *
     * After having tried with the new number, the old number
     * is set again, restoring the status quo. 
     *
     * @param r
     *        the row
     * @param c
     *        the column
     * @param nbr
     *        the number
     * @return true if all sudoku rules are true for the position
     *         after number placement, false otherwise
     * @throws IllegalArgumentException
     *         if assertIsWithinBounds throws it
     */
Check sudoku rules for row r, column c after trying to set nbr.

Bounds are checked with assertIsWithinBounds.

After having tried with the new number, the old number
is set again, restoring the status quo.


Check sudoku rules for row r column c after trying to set nbr . Bounds are checked with assertIsWithinBounds . After having tried with the new number the old number is set again restoring the status quo .
public boolean isValid(int r, int c, int nbr) {
        assertIsWithinBounds(r, c, nbr);
        int oldNbr = getNumber(r, c); 
        setOrClearNumber(r, c, nbr);
        boolean isValid = isValid(r, c);
        setOrClearNumber(r, c, oldNbr);  
        return isValid;
    }
public boolean isValid ( int r , int c , int nbr ) { assertIsWithinBounds ( r , c , nbr ) ; int oldNbr = getNumber ( r , c ) ; setOrClearNumber ( r , c , nbr ) ; boolean isValid = isValid ( r , c ) ; setOrClearNumber ( r , c , oldNbr ) ; return isValid ; }
Check sudoku rules for row r, column c after trying to set nbr.
Check sudoku rules for row r column c after trying to set nbr .