MEESHO Coding Question – Solved

7 Live
Vowel SubString Given a string composed of lowercase letters within the ASCII range 'a'-'z', determine the number of substrings that consist solely of vowels, where each vowel appears at least once. The vowels are ['a', 'e', 'i', 'o', 'u']. A substring is defined as a contiguous sequence of characters within the string. Example s = 'aeioaexaaeuiou' There is a substring to the left that is made of vowels, 'aeioae', which is followed by an 'x'. Since 'x' is not a vowel, it cannot be included in the substring, and this substring does not contain all of the vowels. It is not a qualifying substring. Moving to the right, there are four substrings that do qualify: 'aaeuiou', 'aaeuid', 'aeuiou', and 'aeuio'. Function Description Complete the function vowelSubstring in the editor with the following parameter(s): string s: a string Returns int: the number of substrings that consist of vowels only ('a', 'e', 'i', 'o', 'u') where every vowel appears at least once. Constraints 1 ≀ size_of(s) ≀ 10^5 s[i] is in the range ascii['a'-'z'] (where 0 ≀ i < size_of(s))

Asked in: MEESHO

Image of the Question

Question Image Question Image

All Testcases Passed βœ”



Passcode Image

Solution


Please login to view the solution


Related Questions

| The supply chain manager at one of Amazon's warehouses is shipping the last con… |
| Determine the highest value after executing n steps on an infinite 2D grid that… |
| Amazon Prime Video is developing a new feature called "Segmentify." This featur… |
| In this new stock prediction game launched on Amazon Games, Player 1 provides P… |
| Amazon operates numerous warehouses, with each warehouse holding inventory[i] u… |
| In Amazon's highly efficient logistics network, minimizing operational overhead… |