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.
do not use return at the end the method... Ruby will always return the last line of code.
I can verify the above objection.
What about this board? Your solution says it's finished, but it clearly isn't.
Looks good to me. Maybe you're modifying the original array again!
They work for me: can you check again?
I can imagine that, but in that case, some row/col/square must then fail the test in another part right?
There are situations where the sums of the elements of a row/col/square could be 45, but the numbers to reach 45 are not unique (2,2,2,4,5,6,7,8,9). For some reson my first thought is that these would slip through on squares the easiest.
Going to come back to this and think on how these might impact efficency:
1- using transpose on line 2
2- checking rows and cols for uniqueness first, then regions- rather than all at once as is
That would work too! I think I did that because I had been playing around with Ruby lambdas too much...
This comment is hidden because it contains spoiler information about the solution
Actually, the "Enumerable Magic" katas are explicitly for beginner exploration.
See previous discussions:
WHile this obviously works, I think the point of the excercise was to rebuild this built-in method yourself
even i'm getting same output and i think test cases are wrong
The random tests do not work (in ruby). All expected results are nil, when there are obvious answers.