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.
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
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
can anyone tell me why should use .lower() function?
This comment is hidden because it contains spoiler information about the solution
because people tend to value short code over fast code, just the way it is
Nice one. I was using collections.Counter, but was struggling to find the solution.
Nice!!!! I'm glad I thought of the same solution!!! It feels sooo nice :')
Loading more items...