[Java] Straight Forward Intuitive Solution -explained
\nclass Solution {\n    public int longestBeautifulSubstring(String word) {\n        int result = 0; \n        int start = 0;\n        int n = word.length();\n 
```\nclass Solution {\n    public int longestBeautifulSubstring(String word) {\n        int result = 0; \n        int start = 0;\n        int n = word.length();\n        String vowels = "aeiou";\n        int v = vowels.length();\n        \n        if (n < v) return 0;   //if the word length is less than that of the actual vowel length return 0\n        \n        while (start < n){    //run loop until the start pointer reaches end\n            int end = start;   // end is the start to begin with\n            int k = 0;          //pointer to track vowel\n\t\t\t//loop until if end is less than the word length and the character at end is equal to \n\t\t\t// the character at k in vowel\n            while (end < n && k < vowels.length() && word.charAt(end) == vowels.charAt(k)){\n                while(end < n && word.charAt(end) == vowels.charAt(k)) end++; //to handle repetition after matching\n              k++;\n            }\n\t\t\t// record the max length each time\n            if (k == v) result = Math.max(result, end - start);\n            start = end;  //start is moved to the current end pointer\n            // increment start to next position of \'a\'\n\t\t\twhile (start < n && word.charAt(start) != \'a\') start++;\n        }\n        return result;\n    }\n}\n```
['Java']