Am I missing something or is this not that optimized? Cuz assume that n = 501, the iteration will add 1500 hamming numbers when you don't need that much
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.
@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.
Am I missing something or is this not that optimized? Cuz assume that n = 501, the iteration will add 1500 hamming numbers when you don't need that much
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.
Loading more items...