C++ easy to understand
\nclass Solution {\npublic:\n    \n    int longestBeautifulSubstring(string word) {\n        //longest beautiful substring\n        //next character should be e
```\nclass Solution {\npublic:\n    \n    int longestBeautifulSubstring(string word) {\n        //longest beautiful substring\n        //next character should be equal of greater than the prevoius one\n        //if fails -> start new window\n        //each of english vowel must appear at once i.e. mp.size()==5\n        //word consist only 5 letters i.e. vowels\n        map<char,int> mp;\n        int i=1,j=0;\n        int ans=0;\n        mp[word[0]]++; //entry for first letter in word\n        while(i<word.size())\n        {\n            while(i<word.length() && word[i]>=word[i-1])\n            {\n                mp[word[i]]++;\n                i++;\n            }\n            \n            if(mp.size()==5) ans=max(ans,i-j);\n            mp.clear();\n            j=i;  //start new window as failure occured\n            mp[word[j]]++;\n            i++;\n        }\n        return ans;\n    }\n};\n```
[]