Python O(n) Solution in 5 lines


#1

class Solution:
# @param A : string
# @return an integer
def solve(self, A):

    count = 0
    
    for i in range(len(A)):
        if A[i].lower() in ['a','e', 'i', 'o', 'u']:
            count+= (len(A) - i)
            
            
    return count % 10003