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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Can you explain, please? I wrote the same code..
i'm a beginer and i don't understand why this code is horrible...
HORRIBLE CODE
My one-liner managed to be just a smidge shorter though neither are really good practices.
Just give 'wolf' in a if condition and check it with last element.Looping is not necessary for this problem.
Please once again read the kata description properly and then proceed.
Hi Nanthakumar, thank you very much! That is indeed the error that I'm getting.
How/where would I add the wolf in the code? Where would I put .append?
Thank you again!
Josh
It seems that wolf list is empty, so you can't use wolf[-1] it will result in Indexout of range or print nothing.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
very funny
This comment is hidden because it contains spoiler information about the solution
Such restriction would only work in languages which support arbitrarily-long integers. Otherwise you'd have to pass the inputs as strings, only enforcing the "naive" approach.
Yup I meant
n
to be amount of digits, but now I see how confusing this is. If we want to relate it to input numbers themselves, it would be O(log n) I believe. Or something.I'm pretty sure hobovsky had
n(the one used inside O) = len(str(argument))
in mind, but FArekkusu thought both are the same.Loading more items...