Ad
  • Custom User Avatar
  • Custom User Avatar

    Exercise test cases are now fixed.

  • Custom User Avatar

    Description updated, more and random tests added.

  • Custom User Avatar

    just a comment that given that it doesn't technically do what the kata asks for, it can't really be considered to be a really clever answer

    I'm not sure I follow your logic. Here's the description for reference.

    By repairing the function provided, you will find out exactly how you should respond, depending on the number of dogs he has.

    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.

  • Custom User Avatar

    What happens if there is never more than 101 dogs?

    If you look at the test cases, the maximum value of n is 101. I didn't find it necessary to account for n > 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 in Beta.


    Also, why would you redeclare the list dogs each time your function is called? The list never changes...

  • Custom User Avatar

    This is the same problem in the JavaScript translation, the expected and actual values in the test cases need to be swapped.

  • Custom User Avatar
  • Custom User Avatar

    Thanks for pointing that out. Fixed.

  • Custom User Avatar

    I agree with Vanadis, the variable name should adhere to PEP8 standards. Renaming 'inputArray' to 'input_array' (or 'triplet') would achieve that.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Might this be a result of mutating the input list?

  • Custom User Avatar

    Suggestion received. I added those constraints in the instructions for the kata. Thanks for your contribution and solution, too.