Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
When working this kata in python the variable
str
is a reserved name for data type string. Also there is a methodstr()
. You should name your variable something else so people solving the kata don't have to. Suggestions would bes
orstring
.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?
Thank you for taking the time to answer my questions!
Could you explain what you said further?
I'm not familiar with 'mutates the argument', and your second bullet escapes me completely.
Nifty!
But would you mind explaining what that strange
>>
you used is/does?Yes, if they both drink the cola.
Meaning if that first Sheldon drank but the other did not then you would have 3 Sheldon.
Want to share your code?
I was able to solve it (eventually) using Python.
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 causenames
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.Very interesting solution. I like that you called the function within the function.
Very well done. I tried to use for loops to my detriment. I'll have to keep this in mind for similar problems.
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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Its okay. I thought I was being fairly clever with my solution too until I submitted it and saw other's solutions using
return n ** 3
. Then I felt silly.Loading more items...