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.
It only fails because they used division ('/') instead of floor division ('//') the one you need is explained in the instructions. The failures occur because it is expecting a result rounded down to the nearest whole number and is instead giving a decimal answer in certain tests.
It is a good example of how lambda expressions can be used though. This solution enlarged my perspective.
short code != fast code, Just a half-ass attempt on code golfing 😜
this is
O(n²)
How?
This comment is hidden because it contains spoiler information about the solution
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