Few lines of code


#1

int Solution::solve(string A)
{
int i;
map<char,int>m;
int count=0;
string s=“aeiouAEIOU”;
for(i=0;i<s.length();i++)
{
m[s[i]]=1;
}
for(i=0;i<A.length();i++)
{
if(m.find(A[i])!=m.end())
{
count=count+A.length()-i;
}
}
return count%10003;
}