GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Sunday, 17 July 2022

[Solution] Easy Pronunciation CodeChef Solution




Words that contain many consecutive consonants, like "schtschurowskia", are generally considered somewhat hard to pronounce.

We say that a word is hard to pronounce if it contains 4 or more consonants in a row; otherwise it is easy to pronounce. For example, "apple" and "polish" are easy to pronounce, but "schtschurowskia" is hard to pronounce.

You are given a string S consisting of N lowercase Latin characters. Determine whether it is easy to pronounce or not based on the rule above — print YES if it is easy to pronounce and NO otherwise.

For the purposes of this problem, the vowels are the characters {a,e,i,o,u} and the consonants are the

Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇

other 21 characters.

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.

  • Each test case consists of two lines of input.
    • The first line of each test case contains a single integer N, the length of string S.
    • The second line of each test case contains the string S.

Output Format

For each test case, output on a new line the answer — YES if S is easy to pronounce, and NO otherwise.

Each character of the output may be printed in either uppercase or lowercase. For example, the strings YESyeSyes, and YeS will all be treated as identical.

Constraints

  • 1T100
  • 1N100
  • S contains only lowercase Latin characters, i.e, the characters 

No comments:

Post a Comment