Very Simple and Descriptive C++ code
\nclass Solution {\npublic:\n    int longestBeautifulSubstring(string s) {\n        int n=s.size();\n       map<char,int> mp { {\'a\',0},{\'e\',1}, {\'i\',2}, {
```\nclass Solution {\npublic:\n    int longestBeautifulSubstring(string s) {\n        int n=s.size();\n       map<char,int> mp { {\'a\',0},{\'e\',1}, {\'i\',2}, {\'o\',3}, {\'u\',4} };\n        int ans=0,cnt=0;\n        vector<int> v(5,0);v[mp[s[0]]]++,cnt++;\n        for(int i=1;i<n;i++)\n        {\n            if(mp[s[i]]>=mp[s[i-1]]){\n                cnt++;v[mp[s[i]]]++;\n            }\n            else {\n                bool ok=1;\n                for(int i=0;i<5;i++)\n                {\n                    if(v[i]==0) {\n                        ok=0;break;\n                    }\n                }\n                if(ok) ans=max(ans,cnt);\n                for(int i=0;i<5;i++) v[i]=0;\n                cnt=1;v[mp[s[i]]]++;\n            }\n        }\n        if(cnt)\n        {\n            bool ok=1;\n            for(int i=0;i<5;i++)\n            {\n                if(v[i]==0) {\n                    ok=0;break;\n                }\n            }\n            if(ok) ans=max(ans,cnt);\n        }\n        return ans;\n    }\n}; \n```
[]