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.
apparently, diagonal touching is a thing
I don't get it, how do these boats touch? I don't understand you marked that comment as spoiler, it spoils nothing, it just clarifies the spec. And I still don't get why CW still does not allow notifications for comments marked as spoiler.
This kata needs a complete overhaul. Better input/output format, test verification and random test generator. Author has left the building and I ain't touching the current C++ and C# code. Let's retire this and make the 8x8 variation the author hinted at in the description.
i can't this very very geinus
This is the case for many tests, here's another one:
Example test: multiple solutions are possible
This comment is hidden because it contains spoiler information about the solution
Quite nice and funny kata to solve in fact, good job.
This comment is hidden because it contains spoiler information about the solution
I love this solution - it's certainly the most readable!
@angelplusultra
Distinct() keeps the first instance of an element and discards the rest.
The reason we reverse is because we want to keep the last item, not the first. A requirement from the kata description: "keeping the last ( rightmost ) occurrence of each element"
So we reverse it, remove the duplicates, then reverse it again to get it back to the original order.
Why are you reversing the array in the first place?
Initial
grid
is not extensively tested; every test case is already unique byclues
.There should be test cases with the same
clue
but differentgrid
s.Random tests only consists of a small set of fixed inputs, so it is very easy to hard code against all of them.
it returns only uniqie elements.
So if you have numbers 1,2,3,5,4,1,2,3 your solution would be 5,4,1,2,3.
Method Reverse makes this array look like 3,2,1,4,5,3,2,1. Then method Distinct removes duplicates (second and all further duplicates), so we have it like 3,2,1,4,5. And next reverse returns an answer 5,4,1,2,3
Loading more items...