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
it is. But inbuilt iterators are faster than your own loops. Python generators and iterators are written inside interpreter and are much more efficient.
I tested it out.
This Version for long text: 0.0077
Version with my custom loop: 0.0256
This comment has been deleted.
I tried to use intertools in former katas and it seems it's not integred in Codewars and there's no console to install it, heh.
This comment is hidden because it contains spoiler information about the solution
to be clear, this is not the best solution as it uses O(n^2 log n) time; Blind4Basics solution is better.
This comment is hidden because it contains spoiler information about the solution
Best answer
This is the same cheese I did.
I did not vote it as clever because an fstring could be considered a fundamental python feature.
IMO clever code should be the use of obscure stuff so for Python 3 this should be best practice.
This comment is hidden because it contains spoiler information about the solution
nice
...
Never used python2
Thanks !
Because this is Python 2.
In Python 3 you should use next(filter(...)) instead of filter(...)[0] and list(filter(...)) in order to return a list, not a filter object.
Pls why copying your exact code to understand it gives this result :
(beginning erased)
'filter' object is not subscriptable
Loading more items...