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.
I hope I'm not missing some obvious errors... Approved!
In future I would suggest to save the expected result in a variable before calling
expect
. I don't think it matters here, but if arguments were Lists or whatever, the translation would be vulnerable to input modification, and we don't want that :PRight you are! Updated: fixed basic tests and updated rundom tests.
Please review and approve: https://www.codewars.com/kumite/657ee1f1b5a5150024c181e2?sel=658fe5c9dc80170a4c4dcb15
I believe this can generate random tests that have
start
==end
, which contradicts description. Otherwise it's probably OK.i like it u think out of the box.
Thanks for the feedback. However, I think that the core of the problem is getting this surprise exception and finding out how to deal with it. So the description is not talkative on purpose.
I really like this Kata, but in my opinion the fact that the BadCodeException will get thrown out if the inputCode for unlocking the chest is wrong should be writen in the description, as this wasn't immediately clear to me.
Done both
Not yet: you only did a shallow copy. Meaning the sets are still mutable on the user side with side effect. So:
and the error messagebefore you call to the user's function.cheers
edit: actually, just remove the message: this is exactly what the default message is supposed to be, so you're actually printing it 2 times (the provided message is always added to the default one)
Right. The input data could be forged. I didn't think about that. That wasn't in the spirit of the problem solving, but still possible.
Fixed now, thanks.
I like it. Updated. Slightly changed: i've put the last purpose in the input section.
Marking this as solved.
all good, except I'd change the first 2 lines:
to:
Alright, now i've caught up with terminology. Edited the description, how is it now?
thanks, fixed
you need to remove the tabulation character in the initial solution, and replace it with 4 whitespaces (or a tab char, but produced through cw's editor: cw is using exclusively whispaces, replacing tab char automatically, and this code comes from your editor which uses actual tabulation char. And this is annoying for the user, because it raises this error.
Cheers
No, that wouldn't be enough if not actually incorrect.
In your example, 2 is the successor of 1 because there is an arc going from 1 to 2. that has absolutely nothing to do with the numbers themselves, but only with the "configuration" of the graph itself. As a matter of fact, 2 is a successor of 3 as well as 3 is a successor of 2. Limiting the wording to "dict of sets of ints" is sort of forgetting half of the reason why you build that structure (because one could provide the very same graph as a dict of sets of predecessors, and then you wouldn't have the same dict while both structures are describing the very same graph).
Loading more items...