Problem Description
Given a string A consisting of lowercase characters.
You have to find the number of substrings in A which starts with vowel and end with consonants or vice-versa.
Return the count of substring modulo 109 + 7.
1 <= |A| <= 105
A consists only of lower-case characters.
First argument is an string A.
Return a integer denoting the the number of substrings in A which starts with vowel and end with consonants or vice-versa with modulo 109 + 7.
Input 1:
A = "aba"
Input 2:
A = "a"
Output 1:
2
Output 2:
0
Explanation 1:
Substrings of S are : [a, ab, aba, b, ba, a]Out of these only 'ab' and 'ba' satisfy the condition for special Substring. So the answer is 2.
Explanation 2:
No possible substring that start with vowel and end with consonant or vice-versa.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.