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.
This is not true with every object. More - an alphabet may contain more or less symbols than latin alphabet. There is no hints in the task that it is latin alphabet. That is why solution O(1) does not exist. Best complexity is O(n) where n is the size of the alphabet. I belive that you need О(n) memory for that complexity. This solution complexity is О(n^2).
Wrong:
len
is O(1), since the length is stored as a property in any object.@garborg,
return len(string) > 26
will beO(n)
for only some of the test cases, but not all.At best, it is an incomplete solution, right?
I believe that no one can do it with O(1). The best possible solution O(n) where n is all possible symbols in an alphabet.
This comment is hidden because it contains spoiler information about the solution
True about O(n^2). What is the O(1) version?