[Community Puzzle] Sudoku Validator

It’s not enough to check uniqueness that way (which is also incorrect, btw). Read the statement and break it down in that same way, meaning, for instance, create different functions to check each sudoku property: 1. rows, 2. columns, 3. sub-grids, and combine them all together for a final decision.

1 Like

Thanks for answering. I did create those functions and I tried combining them too. It works on other code editors but it doesn’t work on codingame.

“When summing is not enough” :broken_heart:

summing is the only thing i do :smiley:

Continuing the discussion from [Community Puzzle] Sudoku Validator:

Hello everyone, I can’t figure out the problem with the “sub-grid error” test. I pass all the other tests but this one subgrid test returns “true” instead of false. So I checked with my eyes these subgrids and they’re all valid, only unique numbers from 1 to 9, so it should return true. Can anyone help me figure this out?

Example of error: top-left sub-grid contains two 8s.

Thks for replying but no two 8s in the first subgrid:
[4, 3, 5], [2, 6, 9], [7, 8, 1]

[4, 3, 5], [2, 6, 9], [7, 8, 1] is the first row not the first subgrid.
The first subgrid is [4, 3, 5], [6, 8, 2], [8, 9, 7].

Ok the problem is settled. I hadn’t got the subgrids right. thank you.