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 guess your solution only works for words without repetition and most of the large words have repeating characters.
you are pushing strings on the stack instead of numbers ;-)
You need to make a stream / generator that spits out prime numbers one after another.
@squishy oranges, what do you mean do the summation directly? A double for loop doesnt work for me either. I've tried condensing one of them using sum() and the for loop as a one liner but it still times out.
The user's already solved the kata.
Not an issue. A misreading from you.
Looks like you've solved it
Hint: precalculation / cache
Consider hash of all possible words.
You need to determine the last ribbon used and then build the previous state and so on.
.
It may depend on the language you use but search about 'generator yield + your_language', at least for js and Python.
The text is long enough to find the correct answer. The upper bound is irrelevant for the analysis.
English texts are used here, so
n = 26
. Although, some of the submitted solutions don't rely on the English IC at all.Yup, a double 'for loop' in python isn't efficient enough. It works fine on the tests but times out when I attempt. Funnily enough, I was able to pass everything by doing a very simple approximation (which you're definitely not allowed to do) so I guess the tests need to be more strict..
Edit.. a double loop is actually enough lol, you just need to do the summation directly. Now I get why everyone was saying this is not 4 kyu
no.
Loading more items...