human
Encrypt string with product of number of vowels and consonants in substring of size k | isVowel ( ) is a function that returns true for a vowel and false otherwise ..
function to Encrypt the dtring.
for each substring.
substring of size k.
counting number of vowels and consonants.
append product to answer.
Driver Code"
Solution in Python:
assistant
#Here is code to encrypt string with product of number of vowels and consonants in substring of size k and the other steps required.
 def isVowel ( c ) :
	return ( c == ' a ' or c == ' e ' or c == ' i ' or c == ' o ' or c == ' u ' )
def encryptString ( s , n , k ) :
	countVowels = 0
	countConsonants = 0
	ans = " "
	for l in range ( n - k + 1 ) :
		countVowels = 0
		countConsonants = 0
		for r in range ( l , l + k ) :
			if ( isVowel ( s [ r ] ) == True ) :
				countVowels += 1
			else :
				countConsonants += 1
		ans += ( str ) ( countVowels * countConsonants )
	return ans
if __name__ == ' _ _ main _ _ ' :
	s = " hello "
	n = len ( s )
	k = 2
	print ( encryptString ( s , n , k ) )