This is a program to find out whether there are 4 or more consecutive constants in the input word. t is the number of test cases. n is the word length.
After I submit, the example can be tested correctly but nit the others. So, can u think of some test case that will be failed when I run this program?
To clear a stack, you want something more like this pseudocode…
while the stack has any elements
pop an item off the stack
end while
But one other thing to think about: do you need to have a stack to keep track of the actual consonants? Or could you just have an integer counter that counts the number of consecutive consonants, which you then zero out if you run into a new vowel?