human
Longest substring of vowels with no two adjacent alphabets same | Function to check a character is vowel or not.
Function to find length of longest substring consisting only of vowels and no similar adjacent alphabets.
Stores max length of valid subString.
Stores length of current valid subString.
If curr and prev character are not same , include it.
If same as prev one , start new subString from here.
Store max in maxLen.
Driver code"
Solution in Python:
 ... Give 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 ( x ) :
	return ( x == ' a ' or x == ' e ' or x == ' i ' or x == ' o ' or x == ' u ' ) ;
def findMaxLen ( s ) :
	maxLen = 0
	cur = 0
	if ( isVowel ( s [ 0 ] ) ) :
		maxLen = 1 ;
	cur = maxLen
	for i in range ( 1 , len ( s ) ) :
		if ( isVowel ( s [ i ] ) ) :
			if ( s [ i ] != s [ i - 1 ] ) :
				cur += 1
			else :
				cur = 1
		else :
			cur = 0 ;
		maxLen = max ( cur , maxLen ) ;
	return maxLen
Str = " aeoibsddaeiouudb "
print ( findMaxLen ( Str ) )