Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thank you so much !!!
Those are the 9 sub-squares, the one you picked isn't one of them.
So I searched for that and I found: Each of the 9 sub-squares, of size 3x3, contains a unique value from 1-9.
This is what I mean, there for that square is not valid. So why should I get true ??
Thanks!
Please follow the link to Wikipedia to see an example of sudoku board and what a valid "sub grid" is. Not every 3x3 square of the board is a subgrid where the rules apply, there's only 9 of them.
Hi
looking at the test:
Test.assertEquals(validSolution([
[5, 3, 4, 6, 7, 8, 9, 1, 2],
[6, 7, 2, 1, 9, 5, 3, 4, 8],
[1, 9, 8, 3, 4, 2, 5, 6, 7],
[8, 5, 9, 7, 6, 1, 4, 2, 3],
[4, 2, 6, 8, 5, 3, 7, 9, 1],
[7, 1, 3, 9, 2, 4, 8, 5, 6],
[9, 6, 1, 5, 3, 7, 2, 8, 4],
[2, 8, 7, 4, 1, 9, 6, 3, 5],
[3, 4, 5, 2, 8, 6, 1, 7, 9]]), true);
According to the definitions, every sub grid 3X3 should contain 1-9 digits.
As far as I see, please look at the sub grid starting on position [0, 2] - the number 4
See that it's missing number 5:
4,6,7
2,1,9
8,3,4
Maybe I miss something.
Thanks
This comment is hidden because it contains spoiler information about the solution