Just 7 lines of code || Easiest Solution
Approach\n Describe your approach to solving the problem. \nTwo Pointer Approach: \n\n count variable is looking for the all vowels in current substring window.
# Approach\n<!-- Describe your approach to solving the problem. -->\n**Two Pointer Approach**: \n\n* **count** variable is looking for the all vowels in current substring window.\n* The idea behind **count** variable is, it counts all the **"<"** operations. if it equals 5 it implies we got all the vowels.\n* if sorted sequence breaks we reset our first pointer **"p"** as well as **count** variable i.e. we reset our current window.\n\n\n# Complexity\n- Time complexity: **O(n)**\n\n- Space complexity: **O(1)**\n\n# Code\n```\nclass Solution {\npublic:\n    int longestBeautifulSubstring(string word) {\n        int ans = 0, p = 0, count = 1;\n        \n        for(int i = 1; i < word.length(); i++) {\n\n            if(word[i-1] < word[i])  count++;\n            \n            else if(word[i-1] > word[i])\n                p = i, count = 1;\n            \n            if(count == 5) ans = max(ans,i-p+1);\n        }\n\n        return ans;\n    }\n};\n```
['Sliding Window', 'C++']