Easy Solution C++ Sets


#1
int Solution::solve(string A) {
set<char> S={'A','E','I','O','U','a','e','i','o','u'};
int n =A.length(),count=0;
for(int i=0; i<n;i++)
    if(S.find(A[i])!=S.end()) count+=n-i;
return count%10003;
}