The Minion Game

  • + 1 comment

    In the for loop, we iterate through the each letter of the input string. The logic first checks if it is vowel or not and then finds score.
    Consider "banana" being the string, on first iteration, i value is 0 & the letter will be "b", find how many substrings we can from with this particular "b". They are : "b", "ba", "ban","bana","banan","banana". 6 substrings can be formed with this "b". That 6 is nothing but len(s)-i Please reply back if you still didn't understand