Fundamentals/Longest String Made Up Of Only Vowels
← PrevNext →
Given a string of lowercase characters, remove at most two substrings of any length from the given string so that the remaining string contains only vowels ('a', 'e', 'i', 'o', 'u').
Your aim is to maximize the length of the remaining string. Output the length of the remaining string after the removal of at most two substrings.
NOTE: The answer might be 0, that is, removing the entire string.
Examples
Example 1
Inputearthproblem
Output2
Example 2:
Inputletsgosomewhere
Output3