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.
'Looks like you've solved it'
That's not a kata
issue
, usequestion
.for
is a loop, andindexOf
is a loop-alike method, they're nested so your algorithm isO(n ^ 2)
, it won't work.This comment is hidden because it contains spoiler information about the solution
If you get that error, change your language version to
3.6.0
I can't select other version, but to some people,
3.4.3
is shown too.It is not.
Quesion answered by Chrono79 alredy. Closing.
Thanks Chrono79
Yes, avoid them.
I should avoid nested loops all together? This problem is more difficult than a kyu 5 problem. By the way, thanks for the reply.
It's a problem with your code:
Your code should be O(n)
Mark your post as having spoiler content next time.
Both functions are O(n ^ 2) filter and includes are loop-alike functions and they're nested in the first one, the second one have two nested for loops. Neither won't work. Your code should be faster O(n).
This comment is hidden because it contains spoiler information about the solution
Could you post your code in a comment (with a spoiler tag)? I think there's a problem with your code. In fact, many people say their code works in IDE but it always turns out the code is simply wrong.
Apart from that, you can swap variables in Python like this:
a, b = b, a
.You should be able to select Python 3.6 now. I don't know if that error has anything to do with Python version though.
Damn, so I just wasted my time on this kata? :(
I guess I'll have to rewrite some of the code...
See the python versions available for this kata, they're less than 3.6.
Loading more items...