Print all Substrings of a String that has equal number of vowels and consonants
Improve Article
Save Article
Like Article
Improve Article
Save Article
Given a string S, the task is to print all the substrings of a string that has an equal number of vowels and consonants.Examples:Input: “geeks”Output: “ge”, “geek”, “eeks”, “ek”Input: “coding”Output: “co”, “codi”, “od”, “odin”, “di”, “in”Naive Approach: The basic approach to solve this problem is to generate all the substrings and then for each substring count the number of vowels and consonants present in it. If they are equal print it. Time…