They haven't considered repetition , which is just pathetic. The actual solution would be


#1

int Solution::solve(string A) {
int count = 0;
int n = A.size();
unordered_set result;
for(int i =0;i<n;++i)
{
char c = A[i];
if(c == ‘a’ || c == ‘e’ || c== ‘i’ || c== ‘o’ || c==‘u’ || c == ‘A’ || c == ‘E’ || c== ‘I’ || c== ‘O’ || c==‘U’)
{
for(int j=i;j<n;++j)
{
result.insert(A.substr(i,j));
}
}
}

return result.size() ;

}