Explained easy C++ code


#1
int Solution::solve(string A) {
    unordered_set <char> vowels{'A','E','I','O','U','a','e','i','o','u'}; //Storing in unordered_set because .find() takes O(1) average time.
    int len = A.length();
    int result =0;
    
    for(int i= 0; i< len; i++){
        if (vowels.find(A[i])!= vowels.end()) result = (result%10003) +(len - i)%10003; // Don't forget to take mod 10003. I forgot it at first
    }
    return result%10003;
}