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.
def minion_game(string):
# your code goes here
Stuart = 0
Kevin = 0
#vowels = ['a','e','i','o','u','A','E','I','O','U']
vowels = ['A','E','I','O','U']
vowels= set(vowels)
#vowels = set('A','E','I','O','U')
if len(string) > 0 and len(string) <= 1000000:
for i in range(1,len(string)+1):
for j in range(0,(len(string)+1)-i):
if string[j] in vowels:
Kevin = Kevin +1
else:
Stuart=Stuart+1
if Kevin > Stuart:
print("Kevin {}".format(Kevin))
elif Kevin < Stuart:
print("Stuart {}".format(Stuart))
else:
print('Draw')
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
The Minion Game
You are viewing a single comment's thread. Return to all comments →
def minion_game(string): # your code goes here Stuart = 0 Kevin = 0 #vowels = ['a','e','i','o','u','A','E','I','O','U'] vowels = ['A','E','I','O','U'] vowels= set(vowels) #vowels = set('A','E','I','O','U') if len(string) > 0 and len(string) <= 1000000: for i in range(1,len(string)+1): for j in range(0,(len(string)+1)-i): if string[j] in vowels: Kevin = Kevin +1 else: Stuart=Stuart+1 if Kevin > Stuart: print("Kevin {}".format(Kevin)) elif Kevin < Stuart: print("Stuart {}".format(Stuart)) else: print('Draw')