Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save codeperfectplus/cf4b40a083e70583f339f2dc02f0f8f4 to your computer and use it in GitHub Desktop.

Select an option

Save codeperfectplus/cf4b40a083e70583f339f2dc02f0f8f4 to your computer and use it in GitHub Desktop.
# The Minion Game - HackerRank Solution Python
def minion_game(string):
# your code goes here
vowels = 'AEIOU'
stuart_score = 0
kevin_score = 0
for i in range(len(string)):
if string[i] in vowels:
kevin_score += len(string) - i
else:
stuart_score += len(string) - i
if stuart_score > kevin_score:
print('Stuart', stuart_score)
elif stuart_score < kevin_score:
print('Kevin', kevin_score)
else:
print('Draw')
if __name__ == '__main__':
s = input()
minion_game(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment