Sudoku problem .,.,

please correct and comment my code
i have commented my steps
I HAVE USED N-QUEEN TECHNIQUE I.E PLACING IF POSSIBLE THEN SOLVING REMAINING PART AND IF NOT POSSIBLE RETURN AND BACKTRACK

https://ide.codingblocks.com/s/44449

https://hack.codingblocks.com/contests/c/512/391

You have not checked for sub matrix. same number should not be present in:

  1. That row
  2. That column
  3. 3 X 3 Submatrix.

IN MY CODE row [ r ] [ i ] and similarly colmn 2d array makes sure that number i is not present in the same row and colmn
and if i am able to place all elements according to the condition no repetition of any numer in same row and colmn the theres no need for checking 3x3 submatrix
and by the way my code isnt running till the end
PLEASE CORRECT MY CODE , I HAVE WRITTEN EXPLANATION FOR ALL MY STEPS
PLEASE

3 1 6 5 2 8 4 9 7
5 2 1 3 4 7 8 6 9
2 8 7 6 5 4 9 3 1
6 4 3 9 1 5 7 8 2
9 7 2 8 6 3 1 4 5
7 5 8 4 9 1 6 2 3
1 3 4 7 8 9 2 5 6
8 6 9 1 3 2 5 7 4
4 9 5 2 7 6 3 1 8

Here is an example of the sudoku in which there is no repetation in row and column and sudoku is filled but submatrix has repetations.
It is necessary to check for repetations in submatrix

ok thanks
i will try again :grin:

Try and do let me know if you have any issues😄

why is my code showing runtime error ?
https://ide.codingblocks.com/s/55724

https://ide.codingblocks.com/s/55809
I have corrected some erros.
But it is not able to solve the given sample input sudoku matrix (you can see that from the cout statements printed).
What is the mistake ?