# list all string variations using list comprehension The game ends when both players have made all possible substrings.Ī player gets +1 point for each occurrence of the substring in the string S. Kevin has to make words starting with vowels. Stuart has to make words starting with consonants. Can anybody advise? """Kevin and Stuart want to play the 'The Minion Game'.īoth players are given the same string, S.īoth players have to make substrings using the letters of the string S. There must be a way to optimize the code. It works wonderfully with regular-length strings, like 'banana', but when it comes to really long ones (ones that produce output counter in the vicinity of 7501500, result in a runtime error (or memory error, depending on where you run it). Below is my function to solve the Minion Game problem on HackerRank along with the problem description.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |