Nice Question with alot of Brainstorming required || CPP || Moderate || Sliding window
\nclass Solution {\npublic:\n    int cnt=0;\n    bool help(char a,char b){\n        if(a==b) return true;\n        else if(a==\'a\' && b==\'e\'){\n            c
```\nclass Solution {\npublic:\n    int cnt=0;\n    bool help(char a,char b){\n        if(a==b) return true;\n        else if(a==\'a\' && b==\'e\'){\n            cnt++;\n            return true;\n        }\n         else if(a==\'e\' && b==\'i\'){\n            cnt++;\n            return true;\n        }\n         else if(a==\'i\' && b==\'o\'){\n            cnt++;\n            return true;\n        }\n         else if(a==\'o\' && b==\'u\'){\n            cnt++;\n            return true;\n        }\n        return false;\n    }\n    int longestBeautifulSubstring(string s) {\n        int maxi=0,start=0;\n        char p=s[0];\n        for(int i=0;i<s.length();i++){\n            if(help(p,s[i]) || s[i]==\'u\'){\n                p=s[i];\n                if(s[i]==\'u\' && cnt==4) maxi=max(maxi,i-start+1);\n            }\n            else{\n                cnt=0;\n                while(i<s.length() && s[i]!=\'a\') i++;\n                p=\'a\';\n                start=i;\n            }\n        }\n        return maxi;\n    }\n};\n```
['Sliding Window', 'C++']