A block is defined as group of 9 cells likeBlock B1 consists of cells11 12 1321 22 2331 32 33

Update Rule for Possible values of cell

Possible values for a cell is calculated by removing actual value that is present in other cells in that particular row, column and block from list of possible values of the cell.

If a value is present in a row/column/block then it should not appear in any other cell in the same row/column/block.

For example, for cell 22, possible value is calculated by removing actual values of all cells in row R2, column C2 and Block B1 from Varray 1..9(all possible values)

Update Rule for Actual Value of a cell1.Cell containing only one possible value.2.Value possible only in one cell in a row, column and block

Pseudo Code

For all cellsCheck If actual value is null thencheck list of possible value for cell. If only one value possible, then update cell with this value.For all values 1..9 check if the value is not possible in other cells of that particular row column or block then update cell with that value.

---------- get only possible value in column by comapring all cells possible value for partucular column------------return number if only single possible value found for column else return null----------------/* Check possible values for all cells in a column and if certain value is possible only in one cell thenreturn it*/FUNCTION get_col_loner (m NUMBER, n NUMBER)RETURN NUMBERISp possible_values;t possible_values;r possible_values;l_qry VARCHAR2 (2000);loner NUMBER;counter NUMBER;BEGINp :=possible_values (NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

--p varray contains all the possible values for cells other than input cell--r varray contains possible values for input cell

FOR i IN 1 .. 9LOOPIF i = mTHENl_qry :='select e.c'|| n|| '.poss_values from xx_test e where id ='|| i;

/*Main procedure that calls other procedure to find actual value for each cellActual value is updated in case of following cases1.If poss_value for cell contains only one value2.If get_row_loner return not null value, that is, if certain value is possible in only this cell in a row3.If get_col_loner return not null value, that is, if certain value is possible in only this cell in a col4.If get_block_loner return not null value, that is, if certain value is possible in only this cell in a block*/PROCEDURE update_actual_valueASl_qry VARCHAR2 (1000);l_value NUMBER;l_flag NUMBER := 0;BEGINFOR i IN 1 .. 9LOOPFOR j IN 1 .. 9LOOPIF get_cell_value (i, j) IS NULLTHEN------only one possible value then ------------------DBMS_OUTPUT.put_line ( 'Checking actual value for '|| i|| ' , '|| j);l_qry :='SELECT COLUMN_VALUEFROM TABLE (SELECT e.c'|| j|| '.poss_valuesFROM xx_test eWHERE ID ='|| i|| ')WHERE COLUMN_VALUE IS NOT NULL';