We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- The Minion Game
- Discussions
The Minion Game
The Minion Game
Sort by
recency
|
1272 Discussions
|
Please Login in order to post a comment
stuart = 0 Kevin = 0
Wow, first I created a list with all the words, it worked for the example, but the validation has strings that are VERY long so my code was slow. I then realized I just need to count how many letters are in between the starting points and the end of the word.
like for Banana, let's say starting point is the first "a"
possible words: a an ana anan anana
--> add 5 to score = len(string[start:]) or len(range(start, N))
which is much more efficient.