Counting Vowels by Line X43876


Statement
 

pdf   zip

html

Write a program that finds in a text the first line that contains a specified number of vowels and starts with a lowercase letter.

Input

The input starts with a non-negative integer n in the first line, where it appears with no other information (but maybe with spaces). Then comes a text spanning an arbitrary number of lines, each consisting in an arbitrary number of words, each word made up of lowercase or uppercase letters or punctuation signs. The text is finished with the word "FINISH" in the last line, where it appears with no other information (but maybe with spaces).

Output

The output must be the first line in the text that starts with a lowercase letter and whose words, considered together, add up to exactly n vowels, if one such line exists. Otherwise, the output must report that "No such line with n vowels found.", where n must be the appropriate number.

Public test cases
  • Input

    3
    En un lugar de  
    La Mancha 
    de cuyo nombre no quiero     
    acordarme,  
    no ha mucho tiempo que vivía un hidalgo de los 
    de lanza 
    en astillero,
    adarga 
    antigua, rocín flaco y galgo 
    corredor.
    FINISH      

    Output

    de lanza
    
  • Input

    2
    FINISH

    Output

    No such line with 2 vowels found.
    
  • Input

        0
    Hohoho
    A hppy smrf ywns
    Smurfs mk chldrn hppy
    smUrfs mk chldrn vry hppy
    chldrn mk smrfs vry vry hppy
    STRMPF
    chldrn lv smUrfs
    FINISH

    Output

    chldrn mk smrfs vry vry hppy
    
  • Input

    5
    
    And the winner...
    
    And the winner is...
    
    And the winner will be...
    
         FINISH

    Output

    No such line with 5 vowels found.
    
  • Information
    Author
    José Luis Balcázar
    Language
    English
    Official solutions
    Python
    User solutions
    Python