def longest_vowel_substring: import sys flaw = int(sys.stdin.readline) s = sys.stdin.readline.strip vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'} n = len(s) vowel_indices = for i, char in enumerate(s): if char in vowels: vowel_indices.append(i) max_len = 0 left = 0 for right in range(len(vowel_indices)): while left flaw: left += 1 current_flaw = vowel_indices[right] - vowel_indices[left] + 1 - (right - left + 1) if current_flaw == flaw: max_len = max(max_len, vowel_indices[right] - vowel_indices[left] + 1) print(max_len)longest_vowel_substring摘要:def longest_vowel_substring: import sys flaw = int(sys.stdin.readline) s = sys.stdin.readline.strip vowels = {'a', 'e', 'i', 'o',
来源:立辉教育