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.
By using so many languages, it's not a surprise you can't remember syntax and libraries. It may be better to master a language and then change to another one, instead of "using" lots of languages without even knowing/remembering the basics.
It would be the same, if a person claims to speak 5 languages, but then needs a dictionary to ask a simple question. Sometimes, less is more...
kata's Sensei @raulbc777 should add another example (with an even number of columns),
or change the description to emphasise what's expected.
Many assumed an alternating sum would work. (so did I at first, until I went with
actually implementing the equation)
At that point you've pretty much taught yourself it. I'd say that would be fine.
This comment is hidden because it contains spoiler information about the solution
So to answer @warkentien2's question, is it considered appropriate to use stackoverflow or google to help solve katas? IE, I don't copy and paste the solution from somewhere else, but I use the web to find methods, check syntax, check libraries, etc.
Thanks,
I'm pretty sure it's been there all along, but it's easy to get into a mode where you skim over the text of the error and just read the results, especially in this case where the error looks the same as the ones you were getting but the context is suddenly different.
From the upvotes, it looks like you're not the only one who encountered the problem.
I'm sure there's a user experience lesson in there somewhere.
I hope "The original array should not be modified." was added later. Or I just missed it!
Great kata!
See also
pioraid
's answer to the question above for more infomation.If anyone can find a good description URL I can put that in the error message too.
This is a test of changes to the INPUT array rather than the output result as in all the other tests.
I've added some more text to the test failure message which hopefully makes this clearer.
Javascript last non-random test:
says [1,null,1,2,null,2,null] should stay as it is.
instead of [1,1,1,2,2,2,null] like in other tests.
example:
Random input: [3,null,null,4,3,null,3,4,null,null,2,2,null,null,null]
Test Passed: Value == [3,null,null,4,3,3,3,4,null,null,2,2,null,null,null] // note that input[5] changes
Seems like an error
This comment is hidden because it contains spoiler information about the solution
@ecolban @g964
JavaScript: my algorithm takes too long.
worked up to test 8, but went over runtime for 7654320.
I'll need a raincheck on that number theory if you would be so kind
@idjaw the round() did the trick! thanks!
good point about number of solutions + making past Beta. I'll keep that in mind.
Randomized tests can prevent this kind of cheating. If there was no other way to solve a kata but to hardcode the tests, by the time of 180+ solutions accumulated this discussion would be full of issue reports, not to say this kata would never leave beta. Besides, I skimmed through the solutions before my answer to you, as well as solved this kata myself, and also translated this into a couple of languages, so I really knew this kata is solvable and the description is valid.
Loading more items...