Created
September 8, 2023 13:07
-
-
Save codeperfectplus/cf4b40a083e70583f339f2dc02f0f8f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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