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 ; To store vowels ; If current character is vowel then insert into hash , ; If all vowels are present in current substring ; Driver Code
function isVowel ( x ) { return ( x == ' ' x == ' ' x == ' ' x == ' ' x == ' ' ) ; } function findSubstring ( str ) { let hash = new Set ( ) ; let start = 0 ; for ( let i = 0 ; i < str . length ; i ++ ) { if ( isVowel ( str [ i ] ) == true ) { hash . add ( str [ i ] ) ; if ( hash . size == 5 ) document . write ( str . substring ( start , i + 1 ) + " " ) ; } else { start = i + 1 ; hash . clear ( ) ; } } } let str = " " ; findSubstring ( str ) ;