Question is not correctly explained


#1

question asked to count all substrings starting from vowel and ending at consonant or vice versa…
So required substrings for “abc” would be [“ab”,“ac”,“abc”],these all are satisfying above statement so count would be 3. But in real ans is taking only two length substrings i.e [“ab”,“ac”]


#2

The substring of a string is a subset of the contiguous characters of the string.
In [“ab”,“ac”,“abc”], “ac” is not a substring of “abc”. So in real it is taking [“ab”,“abc”].


#3

[“ab”,“bc”] not [“ab”,“abc”] are the required substrings…


#4

we can not take “bc” because it doesn’t start with a vowel or end with a vowel. It is starting and ending with a consonant which violates the condition given in the question.


#5

Read the question once more carefully and check the examples of the context. You misunderstood the question.