hacker rank python(the minion game)solution

THE MINION GAME


def minion_game(string):
    Kevin = 0
    Stuart = 0
    word = list(string)
    x = len(word)
    vowels = ['A','E','I','O','U']
    for inx, w in enumerate(word):
        if w in vowels:
            Kevin = Kevin + x
        else:
            Stuart = Stuart + x
        x = x - 1
    if Stuart > Kevin:
        print ('Stuart', Stuart)
    elif Kevin > Stuart:
        print ('Kevin', Kevin)
    else:
        print ('Draw')

Comments

Anonymous said…
The program is well written, Here is the working solution for The Minion Game problem in Python 3 language. https://www.new951.com/2020/09/Program%20For%20The%20Minion%20Game%20%20In%20Python%20-%20Hacker%20rank%20Solution.html

Popular posts from this blog

Amazon Web Services

Google Code-In mentorship experience :)

Hacker Rank all java and python problem solutions