Find substrings that contain all vowels | Returns true if x is vowel . ; Function to check whether a character is vowel or not ; Outer loop picks starting character and inner loop picks ending character . ; If current character is not vowel , then no more result substr1ings possible starting from str1 [ i ] . ; If vowel , then we insert it in hash ; If all vowels are present in current substr1ing ; Driver code
def isVowel ( x ) : NEW_LINE INDENT if ( x == ' a ' or x == ' e ' or x == ' i ' or x == ' o ' or x == ' u ' ) : NEW_LINE INDENT return True NEW_LINE DEDENT return False NEW_LINE DEDENT def FindSubstr1ing ( str1 ) : NEW_LINE INDENT n = len ( str1 ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT hash = dict ( ) NEW_LINE for j in range ( i , n ) : NEW_LINE INDENT if ( isVowel ( str1 [ j ] ) == False ) : NEW_LINE INDENT break NEW_LINE DEDENT hash [ str1 [ j ] ] = 1 NEW_LINE if ( len ( hash ) == 5 ) : NEW_LINE INDENT print ( str1 [ i : j + 1 ] , end = " ▁ " ) NEW_LINE DEDENT DEDENT DEDENT DEDENT str1 = " aeoibsddaeiouudb " NEW_LINE FindSubstr1ing ( str1 ) NEW_LINE