Ad
  • Custom User Avatar

    This is a really good example of a challenge that needs to be thoroughly commented. Imagine trying to work with all these different answers and figure out what is going on! Comment your code people lol

  • Custom User Avatar

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

  • Custom User Avatar

    Didn't exactly feel like an 8 kyu exercise. The implementation was simply enough, but the logic I feel like is a bit of a head scratcher.

  • Custom User Avatar

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

  • Custom User Avatar

    What was the reason for having the last line with no line break?

  • Custom User Avatar

    The expected result shows that the basic tests require the trailing '\n' to pass them. My code does not provide that. When I run my solution, it literally prints the exact result requested in the kata. Try it.

  • Custom User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    I learned something here so thank you for your comment.

    What happened was, I was using * arr as when I tried to run the program in python IDE it was throwing an error that I gave the function 8 positional arguments.

    This was because I did not define the array and then use it's name (arr) to pass it to the function. Once I removed * and defined the array, then passed it, it worked.

    The error messages in the tests confused me because the first sample test error message was that None should equal 6. I thought that meant that it was skipping the trigger return statement in my loop that would terminate the function, returning what result was first initialised as. I thought for some reason the return statement in the loop was not working in codewars lol

    So yea, now I understand and thank you once more.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    oh damn, so it is spelling mistakes. let me try that and I will update here lol thank you

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Loading more items...