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.
Yes, the check on this line will pass. But column and segment checks will fail. Because the only way to get 45 from different numbers from 1 to 9 is 1+2+3+4+5+6+7+8+9.
Look at my solution. It works. Everytime
1+1+1+5+5+5+9+9+9=45
However, this is not a valid row/column.
1+2+3+4+5+6+7+8+9=45
You should have checked to see if the sum of the list is 45. You don't have to keep checking the list of numbers from 1 to 9
That would be the same, sure, but it seemed more explicit.
This comment is hidden because it contains spoiler information about the solution
You're right ;-)
you sure? ;)
That's a basic python trick ;-)
Oh, and don't forget the "spoiler" flag, otherwise these comments are displayed on the dashboard.
Akthough I agree with the principle (see DRY), turning such a short piece of code into a separate function would not make it more simple or readable.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution