human
Longest substring of vowels with no two adjacent alphabets same | Function to check a character is vowel or not.
Function to check a substring is valid or not.
If size is 1 then check only first character.
If 0 'th character is  not vowel then invalid.
If two adjacent characters are same or i 'th char is  not vowel then invalid.
Function to find length of longest substring consisting only of vowels and no similar adjacent alphabets.
Stores max length of valid substring.
For current substring.
Check if substring is valid.
Size of substring is ( j - i + 1 ).
Driver code"
How can the above be solved in Python?
 Write me a code to longest substring of vowels with no two adjacent alphabets same and the other steps required?
assistant
#Here is code to longest substring of vowels with no two adjacent alphabets same and the other steps required.
 def isVowel ( c ) :
	return ( c == ' a ' or c == ' e ' or c == ' i ' or c == ' o ' or c == ' u ' )
def isValid ( s ) :
	n = len ( s )
	if ( n == 1 ) :
		return ( isVowel ( s [ 0 ] ) )
	if ( isVowel ( s [ 0 ] ) == False ) :
		return False
	for i in range ( 1 , n ) :
		if ( s [ i ] == s [ i - 1 ] or not isVowel ( s [ i ] ) ) :
			return False
	return True
def findMaxLen ( s ) :
	maxLen = 0
	n = len ( s )
	for i in range ( n ) :
		temp = " "
		for j in range ( i , n ) :
			temp = temp + s [ j ]
			if ( isValid ( temp ) ) :
				maxLen = ( max ( maxLen , ( j - i + 1 ) ) )
	return maxLen
if __name__ == " _ _ main _ _ " :
	Str = " aeoibsddaeiouudb "
	print ( findMaxLen ( Str ) )