1class Solution:2 def longestBeautifulSubstring(self, word: str) -> int:3 g = ""4 count = m = 05 for x in word:6 if g and x < g[-1]:7 count = 08 g = ""9 if not g or x > g[-1]:10 g += x11 count += 112 if g == "aeiou":13 m = max(m, count)14 return m
WPM •0 •0
ACC •0 •0
TIME •0