Question: / * * * First check whether it's a valid move to put the given number at the given position, * and then put the
First check whether it's a valid move to put the given number at the given position,
and then put the given number into the board if and only if it's a valid move.
@param row The row you want to fill number
@param col The column you want to fill number
@param val The number you want to fill in
@param board The current Sudoku board
@param original The boolean array parallel to board, representing whether
there's a preexisting number for each position
@return if either board or original is null
if the row is out of valid range ~
if the column is out of valid range ~
if val is out of valid range ~ and Config.EMPTY
if the number at the current position row col is preexisting
if there's a conflict in the board after filling in val at row col
Note: remember to call checkConflictForBoard for this
if there's a success filling in the number. If and only if in
this case, should you actually place the number into the board.
Note: You need to check the conditions exactly in the above order.
public static int fillNumberint row, int col, int val, int board, boolean original
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
