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.
"foobar00" turns into "foobar01" because the end result after the string was incremented was 2, which did not take up both digits. If it was "foobar09", then it would turn into "foobar10", because the result now takes up both zeros which were in the input. In the case of "foobar099", 99 turns into 100, meaning it now takes up 3 digits. In "foobar099", there are 3 numbers at the end, so you would not include the extra 0 after incrementation.
Thank You. That was a really concise explanation.
Okay, thanks. I understood
Yes, and no.
Because of some specifics (which are partially explained in docs), usually kata have two kinds of tests which are run when you hit the ATTEMPT button: so-called "fixed tests", and so-called "random tests". Fixed tests are the same every time. Random tests are generated separately for every test run. Ideally, when a solution has some bug, there should be always at least one fixed test case which fails every time on wvery run of the solution, accompanied by at least a few failing random tests, which can be different every time. This is an ideal situation. But it happens quite often that coverage of the fixed test is either neglected by authors, or difficult to ensure for some types of problems. In such case, it can happen that your faulty solution will pass all fixed tests, but can fail some randomly generated tests. As a result, you will see no pattern between failed test runs.
This is one possible explanation of the behavior you observe. Other reasons are also possible, but we cannot say anything for sure without seeing your code.
No no, I didn't mean that. I mean if I run the same code more than once the test cases that failed should be same but each time I run the code there is a change of failed test cases.
In a class, there are three types of methods: instance methods, class methods, and static methods. Instance methods are defined with a mandatory parameter
self
, alongside any other required parameters. For class methods, we use the@classmethod
decorator before the method and include a mandatory parameter namedcls
, along with other parameters. Static methods, on the other hand, don't require a decorator and function like normal Python functions without needing a mandatory parameter. When written within a class, they behave as static methods by default, but you can add clarity by using the@staticmethod
decorator. Remember it's common practice to use decorators and highly recommended.Why did you use @staticmethod on top of all the functions? (I am a newbie so pardon my questions)
really awesome
Yes, this is the whole meaning of "random tests".
weird! same code ran twice but different test cases failed!!!!!!!
No chromosome is written like this, X comes first then Y.
Not good practice as it should be simple and readable
this not good good practice when it's not rot13 case
Double is used for slicing not indexing
In your problem I don't think you need a constructor(you can pass) for your given tasks.
Loading more items...