concise solution (faster than 100% typescript submissions)
Runtime: 99 ms, faster than 100.00% of TypeScript online submissions \n\nfunction longestBeautifulSubstring_2(word: string): number {\n    let maxCount = 0\n   
Runtime: 99 ms, faster than 100.00% of TypeScript online submissions \n```\nfunction longestBeautifulSubstring_2(word: string): number {\n    let maxCount = 0\n    let l = 0, r = 1\n    let vowelCount = 1\n\n    while (r < word.length) {\n        let key_char = word[r]\n        if (key_char < word[r - 1]) {\n            vowelCount = 1\n            l = r\n        } else if (key_char > word[r - 1]) {\n            vowelCount++\n        }\n        if (vowelCount === 5) {\n            maxCount = Math.max(maxCount, r - l + 1)\n        }\n        r++\n    }\n    return maxCount\n}\n```
['TypeScript', 'JavaScript']