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.
good solution
this letter.isalpha() == True is equal to letter.isalpha()
lmao
This solution is slow, but the time complexity is still O(n).
This is because the length of the alphabet is a constant 26, so it would be O(26n) which is still O(n).
index() raise ValueError when the substring is not found, and it could be not found, because in the description "If anything in the text isn't a letter, ignore it and don't return it." So, not letter could be in text, but you loking for a letter only.
This comment is hidden because it contains spoiler information about the solution
*believe
sorry, had to. Also maybe a good solution is not about using as less code as possible which sometimes seems just unnecessary elitist. If every not so knowledgable person has a hard time reading your code it might make it extremely hard to get people to work with you at the same code.
Best solution is always if somebody else can easily read it. The only reason that would not be the case is when it slows down the code noticeable, but then you would probably not use python anyways...
This comment is hidden because it contains spoiler information about the solution
As a beginner, it's more readable than solutions using ord().
Also .index() uses a linear search to find the letter in alphabet in every iteration...
Same here-- same error, when clicking 'Run Tests' in Python.
This comment is hidden because it contains spoiler information about the solution
Wow phenomenally bad
Oh my gosh this is terrible
Loading more items...