• Custom User Avatar

    Solutions that depend on the hidden number being non-zero pass. Consider if you want this. If you do, the description should probably specify the number will be positive. If you don't, there should probably be a test with a hidden 0. ( Negative numbers are also a possibility, but are less likely to trip up solutions. )

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    ( Python )

    Failure test message is constructed from argument that solver has had their dirty hands on. Don't just calculate expected value first, pass solver a ( deep ) copy of the input ( and, just in case the reference solution inadvertently modifies its argument, it too ).

    ( I'd fix it, but I don't know how to make a reliable deep copy in Python. )

  • Custom User Avatar

    not any(arr) is O(n), but iff not arr, that's O(1). but only in that case, true.

  • Custom User Avatar

    True. But it's harder to spot the base case, here (in my mind, at least)

    Note: not arr is actually O(1) so I wouldn't have phrased the sentencve like that (but maybe I'm just not following your train of thoughts)

  • Custom User Avatar

    Thank you KayleightWasTaken! You we pointing me about this issue of test cases in a different kata but I forgot to change it here :/ . I will go around my other katas shortly and modify it and make sure not to do this mistake again!

    So what happens with the functions that generate structures. I have one for generating bad structures generate_bad_structure which should ideally test for False cases and generate_nested which generate True case structures and 50% chance to select one of them. generate_bad_structure generates random nested arrays and usually they are False structures but I also noticed that ocasionally it does create some true structures ( usually, when the structure is small like [ [],[],[] ]). I think, they should be fine but, if not, please let me know.

  • Custom User Avatar

    Hi! Yes, you are definitely right about antipattern. Just have approved the proposed translation by KayleighWasTaken which tackles the problem

  • Custom User Avatar

    Somewhat refactored the tests here. Didn't touch the test generation code itself though, not currently awake enough to try to parse what exactly it's trying to achieve, though generate_bad_structure seems to generate True cases sometimes, and the inverse for generate_nested?

  • Custom User Avatar

    I'll have a go at cleaning up the tests a little and adding assertion messages etc then.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
  • Custom User Avatar

    Also, OP, focus the Beta stage on one language. Now you have to fix them in two languages.

  • Custom User Avatar

    It would be much better if the OP published one kata, got it through the beta stage applying all remarks raised by reviewers, and then moved to creating the rest of challenges. Because now, the OP has four published kata, all affected by the same issues, collecting downvotes due to technical problems.

  • Custom User Avatar

    Specify that "starting from 0" does not mean the returned list starts with that 0 ( it would make a lot of sense if it did actually ).

  • Loading more items...