It's difficult to know what's wrong without seeing the input that produced this result or your code. That does appear to be a valid sudoku board. Is it possible that your code is overwriting already solved squares given to you in the input?
Edit: I see what happened, your result array is rotated. You likely mixed up row and column or x and y somewhere.
Thank you so much for your prompt! You've been very helpful to me. Otherwise, I would have spent a lot more time looking for the reason!
It's difficult to know what's wrong without seeing the input that produced this result or your code. That does appear to be a valid sudoku board. Is it possible that your code is overwriting already solved squares given to you in the input?
Edit: I see what happened, your result array is rotated. You likely mixed up row and column or x and y somewhere.
Greetings!
I have got this result:
[
[5, 6, 1, 8, 4, 7, 9, 2, 3],
[3, 7, 9, 5, 2, 1, 6, 8, 4],
[4, 2, 8, 9, 6, 3, 1, 7, 5],
[6, 1, 3, 7, 8, 9, 5, 4, 2],
[7, 9, 4, 6, 5, 2, 3, 1, 8],
[8, 5, 2, 1, 3, 4, 7, 9, 6],
[9, 3, 5, 4, 7, 8, 2, 6, 1],
[1, 4, 6, 2, 9, 5, 8, 3, 7],
[2, 8, 7, 3, 1, 6, 4, 5, 9] ]
It seems confined in the terms of Sudoku, but the site considers him incorrect. What do you advise me to do? Thanks!