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.
Worst practice. This solution will not work, for example, if all numbers are equal to 5.
This is not a valid solution!! It will not correctly identify boards with repeated digits. See this issue
I had same idea, but checking if sum is correct does not prevent gibberish summing to 45 though.
Aaaaaaand now I feel stupid with my solution :D
It doesn't work. If you input board full of 5's it prints out true.
Not always sum of all numbers is a correct answer. For example, the sequence can be like: 1 1 1 7 6 7 8 9 5 = 45.
ERROR:
unsigned int example2[9][9] = {{45, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 45,0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 45, 0, 0},
{0, 45, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 45, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 45,0},
{0, 0, 45, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 45,0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 45},};
Smart solution indeed!
Yes it's clever but I probably wouldn't hire you as a developer :). Just think of somebody else having to fix a bug or implement a change in code like that!
I really like how you managed checking the blocks with the vector. I was trying to think through how to do it that way it and couldn't see it clearly.
I like it!
This comment is hidden because it contains spoiler information about the solution
It is not enough if you take a valid solution and replace all 2's by 1's and all 8's by 9's, you still get sum 45 but it is not a correct solution.
In description for task written: ...contain all of the digits from 1 to 9.
What for write more than required?
As we are creating a sudoku validator, we can not make assumptions regarding the inputs. We need to take care of all conditions. If you see the example 2 in the question, there are 0s in the sudoku puzzle.
Loading more items...