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.
not a valid solution
enumerate() returns a special generator from an iterable. In itself, it has O(1) runtime and does not split anything. If anything it is the iterator of
str
that is "splitting" (or better: iterating) the string into individual characters if you mean that. enumerate() just adds indices on top of that.no, because letter is lowercase
that's clever but the time complexity is crying so therefore this should be mark higher as "clever" but not "Best Practice?.
don't understand why it is the first plase. this is solution - O(n**2), but it is 0(n)
couldn't you just return letter ? no need for return string[i]. The same output without enumerate
if input is [3,200,500] ,there is fail
how??
Most people like small solutions rather than the efficient ones
It will be O(n^2) because of count, but good and fast solution overall.
to count upper and lower case letters as the same character. Otherwise using .count("A") wouldn't count in all lowercase "a" (as supposed to according to the instructions).
This comment is hidden because it contains spoiler information about the solution
yes starting value of range() is 0 so defining it as 0 makes no difference.
can anyone tell me why should use .lower() function?
Could be improved by caching the previous result and just multiplying it by 2 instead of calculating the whole 2^n.
Loading more items...