Ad
  • Custom User Avatar

    You can do so.

  • Custom User Avatar

    When working this kata in python the variable str is a reserved name for data type string. Also there is a method str(). You should name your variable something else so people solving the kata don't have to. Suggestions would be s or string.

  • Default User Avatar

    Me too!! this was going to be my sugggestion! sometimes my code works in console but it doesn't workk here.. and I take 3-5 minutes before I relise that it was because the kata was using an older verions (ofc, I know how tot check now, but Its kinda of a mixed bag that I have to randomly select a kata and hope it suppoerts a version) we need more filtering!!

  • Custom User Avatar

    I'd like there to be a way to add different versions of a programming language to a Kata. For example: adding Python version 3.4 to a Kata that is only available with Python 2.7. I attempted to do this here:

    https://www.codewars.com/kumite/546c3edbbed2e13ab5000223?sel=5928ecfdaf58a648ae00000f

    What I found was that I could not start a new python translation because the Kata had already been translated into Python (but only version 2.7). So I took the 2.7 version and forked it and set up a new Python translation in version 3.4. It was approved, as you can see, but when you go to solve the Kata it still only lists 2.7 in the versions available.

    So I'm not sure if there is supposed to be another way to do this, if there is someone please point it out to me. If not, can we please get this functionality?

  • Custom User Avatar

    Thank you for taking the time to answer my questions!

  • Custom User Avatar

    Could you explain what you said further?
    I'm not familiar with 'mutates the argument', and your second bullet escapes me completely.

  • Default User Avatar

    This solution is actually very BAD practice!

    You shouldn't delete elements of your array:

    • first, it mutates the argument (bad practice)
    • second, deletion in a list is O(N) by itself so it makes your solution unefficient.
  • Default User Avatar

    Thank you Kolrim :-)

  • Custom User Avatar

    Nifty!

    But would you mind explaining what that strange >> you used is/does?

  • Custom User Avatar

    Yes, if they both drink the cola.

    Meaning if that first Sheldon drank but the other did not then you would have 3 Sheldon.

  • Custom User Avatar

    Want to share your code?

    I was able to solve it (eventually) using Python.

  • Custom User Avatar

    From what I can see it should pass a few tests. However there are test cases that will use very high int numbers for r. Including 1,000,000,000. So eventually your code would end up taking too long to run to pass all the tests, or cause names to get too large for memory. There is a mathmatical way to figure it out that will run quickly enough to pass all the tests.

  • Custom User Avatar

    Very interesting solution. I like that you called the function within the function.

  • Custom User Avatar

    Very well done. I tried to use for loops to my detriment. I'll have to keep this in mind for similar problems.

  • Custom User Avatar

    Nicely done. I couldn't seem to figure out a way to step through the array while removing items that wouldn't mess it up. Thus my solution ended up more complex.

  • Loading more items...