You are viewing a single comment's thread. Return to all comments →
The number of subsets of a substring is same as length of string minus its index.
def minion_game(string): stuart_score, kevin_score = 0, 0 for i in range(len(string)): if string[i] in "AEIOU": 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)
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 →
The number of subsets of a substring is same as length of string minus its index.