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.
Could someone tell me what this asterisk means?
Your solution has to compile the regex for every element in the array. You could compile it first to eliminate that overhead, but I suspect it would still be slower as it involves multiple calls to match instead of a single call. str.join and re.findall are both very efficient operations.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Python 3.8 adds the walrus operator which allows you to assign the result of the sum in the if statement to a variable and reuse it later in the comprehension.
The only difference is that in the linked kata is that the range has the following criteria:
and this can be achieved by adding just 1 line small line.
Actually, it's not. The two are not solvable with the same code.
Duplicate https://www.codewars.com/kata/51ba717bb08c1cd60f00002f/
You might find this article on the Python wiki useful:
https://wiki.python.org/moin/TimeComplexity
This comment is hidden because it contains spoiler information about the solution
I read that as stating s1 and s2 will only include letters from a to z. ie. don't worry about non-alphabetic characters.
This comment is hidden because it contains spoiler information about the solution
Loading more items...