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.
I don't think there's much of a difference, at least performance wise, to calling lower() on the whole string or each individual character. Strings are, in actuality, just character arrays. By calling lower() on the whole string, the function must still be applied to each individual character.
I know it but i dont know the third argument
Using .count() inside a loop is quite costly. An alternative is to use 'Counter' from the 'collections' library:
from collections import Counter
This comment is hidden because it contains spoiler information about the solution
Although this isn't necessary within this context, I gotta say, this is quite robust regardless of the context! Nice work :P
You have too much patience to write this... I hate to admit it, but that was the approach I was taking until I thought of using a dictionary to hold the cylcic patterns.
This comment is hidden because it contains spoiler information about the solution
Really nice solution. I made a similar solution but with more variables in place (a lot of elif's), so this solution is shorter compared to mine, but pretty much the same efficiency :D.
This looks more efficient than the top rated one on the list, but there can be some improvements. By adding
text = text.lower()
you won't repeatedly call the lower() function, which helps with efficiency. Also, you can use a dictionary rather than two sets. I'm not a pro at python or even close to it, but I'm making an effor to review solutions to see how I could change it to make improvements. I even came to the dictionary conclusion by asking chatgpt (facepalm), so I refuse to take any credit! Nice solution regardless :).