simple and easy C++ solution 😍❤️‍🔥
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n\nclass Solution {\npublic:\n    int longestBeautifulSubstring(string s) \n    {\n        string
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n```\nclass Solution {\npublic:\n    int longestBeautifulSubstring(string s) \n    {\n        string need = "aeiou";\n        int ans = 0, n = s.size();\n        int i = 0, j = 0, cur = 0;\n        while(j<n)\n        {\n            if(s[j] == need[cur])\n            {\n                while(s[j] == need[cur]) j++;\n                cur++;\n                if(cur == 5) ans = max(ans, j-i);\n            }\n            else \n            {\n                cur = 0;\n                while(j < n and s[j] != need[cur]) j++;\n                i = j;\n            }\n        }\n        return ans;\n    }\n};\n```
['String', 'Greedy', 'Sliding Window', 'C++']