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's short, but the filter function call is equialent to [c for c in x if str.isdigit(c)] which has the disadvantage that it will go through the whole word and create an array even if there's only one digit and it can be the first character in the word. If we change the call to filter into this:
next(int(c) for c in x if c.isdigit()) this will create a generator which will in this usage will stop on first digit found...
@CrazyMerlyn:
Oops, didn't thought about it, my bad :p
@acaccia, a solution or spoiler should be marked spoiler even when discussing it on a solution thread.
While someone who hasn't solved this problem can't access the solution, the comment is still visible on the home page.
This comment is hidden because it contains spoiler information about the solution