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.
This comment is hidden because it contains spoiler information about the solution
Thanks! I had fun finding as many optimization tricks as I could. This is a good kata.
Thanks! Unfortunately, this brute force method takes a very long time to solve the 6x6 version, so I'll need to think of something more subtle for that kata.
I figured it out: one of the tests has
abs
spelledAbs
:My code handles an ArgumentOutOfRangeException in that case and returns an
"ERROR ...
string, which is somehow causing theINTERNAL ERROR (EXCEPTION): Unknown char
error to be presented in the output.Anyway, calling
ToLower()
on the input lets my code get past this issue, so now I can go back to fixing the other bugs in my solution.I have a solution which passes the first set of submit tests, but then fails with this error:
I don't think this is coming from my code...
You're right, there was a mistake in the test which corresponded exactly to a bug in my solution. I've fixed it and re-published.
Some of the numbers in the test cases are too big to fit in
int
, but the initial state of the solution declares the method aspublic static int TripleDouble(int num1, int num2)
. It should bepublic static int TripleDouble(long num1, long num2)
instead.Thanks! There appears to be a bug which is preventing me from updating the example test cases. I've filed a bug about it (https://github.com/Codewars/codewars.com/issues/144) and added a note to the kata description pointing out the typo in the example test cases.
@despinozac is probably on the right track. The test you're referring to is checking the values directly against the array passed in to the constructor, it's not using the
read
method on your implementation. The root problem is probably either in yourwrite
method or something like @despinozac suggested.Sorry about that. I've updated the example test to use
Test.assertSimilar
rather thanTest.assertEquals
. The submission test uses a more sophisticated algorithm to check the results, rather than just comparing your result to another object.This is an interesting and educational kata. Thanks for making it!
There are a few minor issues with the description:
The notation explanation could be clearer. You could borrow the table from Wikipedia, which is pretty clear:
The markdown for the table above looks like this:
Also, the second assertion in the sample tests expects the correlation to be
-.05
, but it should be-0.5
.Examples added.
This comment is hidden because it contains spoiler information about the solution
Yeah, I'm planning on making a more advanced version. I'm thinking that will include AND and OR in the WHERE clause, GROUP BY, ORDER BY, and HAVING. Think that'll be advanced enough? (I considered including wildcards and aliases, but I feel like that would just add complexity without making it more interesting. What do you think?)
The helper functions are not defined when I run tests. I'm not sure if this is a problem with the kata or a glitch in CodeWars - the "submit" tests seem to run OK...
Update:
For anyone who doesn't want to write their own
display
function, here's the one I used:Loading more items...