Simple c++ code , easy also


#1

bool isvowel(char c)
{
if(c==‘a’||c==‘e’||c==‘i’||c==‘o’||c==‘u’||c==‘A’||c==‘E’||c==‘I’||c==‘O’||c==‘U’)
return true;
else return false;
}
int Solution::solve(string A)
{
long long int s=0;
for(int i=0;i<A.size();i++)
if(isvowel(A[i]))
s=(s+(A.size()-i)%10003)% 10003;
return s;
}