Find substrings that contain all vowels | Returns true if x is vowel . ; Function to check whether a character is vowel or not ; Function to FindSubstrings of string ; hash = set ( ) ; To store vowels ; If current character is vowel then insert into hash ; If all vowels are present in current substring ; Driver Code
def isVowel ( x ) : NEW_LINE INDENT return ( x == ' a ' or x == ' e ' or x == ' i ' or x == ' o ' or x == ' u ' ) ; NEW_LINE DEDENT def FindSubstring ( str ) : NEW_LINE INDENT start = 0 ; NEW_LINE for i in range ( len ( str ) ) : NEW_LINE INDENT if ( isVowel ( str [ i ] ) == True ) : NEW_LINE INDENT hash . add ( str [ i ] ) ; NEW_LINE if ( len ( hash ) == 5 ) : NEW_LINE INDENT print ( str [ start : i + 1 ] , end = " ▁ " ) ; NEW_LINE DEDENT DEDENT else : NEW_LINE INDENT start = i + 1 ; NEW_LINE hash . clear ( ) ; NEW_LINE DEDENT DEDENT DEDENT str = " aeoibsddaeiouudb " ; NEW_LINE FindSubstring ( str ) ; NEW_LINE