Ad
  • Custom User Avatar

    sure thing. actually i found a couple of amazing solutions that i didn't think of. this website is awsome

  • Custom User Avatar

    You're welcome, recursion is a bit tricky until you get the hang of it. Now that you solved it without it, see other solutions that use recursion and analyze how they work.

  • Custom User Avatar

    you are right. i fixed my code using a while loop instead of recursion. it worked fine. thanks again for your time.

  • Custom User Avatar

    No problem, the answer to your problem was there too btw:

    Check if your solution passes two successive calls with different inputs. It's sometimes the case that solution contains some global variables or static members and stale state is carried over from one invocation to another.

  • Custom User Avatar
  • Custom User Avatar

    Already answered below.

  • Custom User Avatar

    Because you used a global var, and it keeps its value when your function is called more than once. Please, I know you said you read it, but read this again: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution it says there also how to post code with markdown formatting, etc. We wrote it so we don't need to repeat the same over and over.

  • Custom User Avatar

    I mean, there are different labels for posts here, it's documented in the github page, I'll copy and paste what it says about it:

    • Mark your post with Question label if you have some problems solving the kata and want to ask for help.
    • Mark your post with Suggestion label if you want to propose some changes or improvements to discussed kata. It's also customary when posting a translation to post a link as a suggestion as well, in case the notification gets lost.
    • Mark your post with Issue label only if you are perfectly sure that kata is in some way broken, and needs to be edited and fixed. If you have difficulties with solving the kata, raise a Question, and not an Issue.
  • Custom User Avatar

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

  • Custom User Avatar

    i posted my code in the questions section

  • Custom User Avatar

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

  • Custom User Avatar

    Without a way to reproduce your claim, this is "trust me bro". And that trust is usually not deserved with a comment to this effect. There's no way that others can know that this is different. It probably doesn't lead anywhere either even if you're right, because that still doesn't say what the problem is.

  • Custom User Avatar

    Please don't create issues when after more than 11k solutions in Python, the problem is unlikely in the kata. Use Question as the github page says and post your code.

  • Custom User Avatar

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

  • Custom User Avatar

    that's probably because of the random cases. your code might return a right answer in a specific situation, for example when the matrix is empty and it passes the random tests that generate such matrices

  • Loading more items...