6 lines of code in C++

programming
Tags: #<Tag:0x00007f241eb7ee38>

#1

int Solution::solve(string A) {
int mod=10003,count=0;
for(int i=0;i<A.size();i++)
{
if(A[i]==‘A’ ||A[i]==‘E’ ||A[i]==‘O’ ||A[i]==‘U’ ||A[i]==‘I’ ||A[i]==‘a’ ||A[i]==‘o’ ||A[i]==‘i’ ||A[i]==‘e’ ||A[i]==‘u’ )
{
int n=A.size()-i;
count=((count%mod)+(n%mod))%mod;
}
}
return count%mod;
}