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.
Fixed.
Exercise test cases are now fixed.
Description updated, more and random tests added.
I'm not sure I follow your logic. Here's the description for reference.
I 'repaired' the function by rewriting it. My solution then responds, as per the katas requirements, depending on the number of dogs,
n
.I can appreciate that you don't find my solution 'clever', you are entitled to your opinion. Just understand that I don't control how other users vote on solutions, everyone has their own opinion.
What happens if there is never more than
101
dogs?If you look at the test cases, the maximum value of
n
is101
. I didn't find it necessary to account forn > 101
because of that.That is what the
Beta
process is supposed to do, catch issues like this before the kata gets approved and ranked. Although I cannot find the docs right now, I think there is a limit of ~200 people solving a kata and then the test cases are locked in. I could be wrong but I seem to remember something like that being talked about before.Let's say the kata test cases were modified now to test
n > 101
. The problem is about half of the solutions I just looked at don't account for that and they would all be invalidated. These types of comments would be more helpful in katas that are still inBeta
.Also, why would you redeclare the list
dogs
each time your function is called? The list never changes...This is the same problem in the JavaScript translation, the expected and actual values in the test cases need to be swapped.
^
Thanks for pointing that out. Fixed.
I agree with Vanadis, the variable name should adhere to PEP8 standards. Renaming 'inputArray' to 'input_array' (or 'triplet') would achieve that.
It seems like a common thread among kata with list inputs. After getting frustrated on another kata like this, I don't think I could ever make this mistake again, so I guess it's a good challenge for learning.
Might this be a result of mutating the input list?
Suggestion received. I added those constraints in the instructions for the kata. Thanks for your contribution and solution, too.