adplus-dvertising

Easy Pronunciation CodeChef Solution

We Are Discuss About CODECHEF SOLUTION

Easy Pronunciation CodeChef 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¬†44¬†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¬†SS¬†consisting of¬†NN¬†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}{a,e,i,o,u} and the consonants are the other 2121 characters.

Input Format

  • The first line of input will contain a single integer¬†TT, 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¬†NN, the length of string¬†SS.
    • The second line of each test case contains the string¬†SS.

Output Format

For each test case, output on a new line the answer ‚ÄĒ¬†YES¬†if¬†SS¬†is easy to pronounce, and¬†NO¬†otherwise.

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

 

Easy Pronunciation CodeChef Solution

Constraints

  • 1‚ȧT‚ȧ1001‚ȧT‚ȧ100
  • 1‚ȧN‚ȧ1001‚ȧN‚ȧ100
  • SS¬†contains only lowercase Latin characters, i.e, the characters¬†{a,b,c,‚Ķ,z}{a,b,c,‚Ķ,z}

Sample Input 1 

5
5
apple
15
schtschurowskia
6
polish
5
tryst
3
cry

Sample Output 1 

YES
NO
YES
NO
YES

Explanation

Easy Pronunciation CodeChef Solution

Test case¬†11:¬†“appleapple” doesn’t have¬†44¬†or move consecutive consonants, which makes it easy to pronounce.

Test case¬†22:¬†“\textcolor{red}{schtsch}urowskia\textcolor{red}{schtsch}urowskia” has¬†77¬†consecutive consonants, which makes it hard to pronounce.

Test case¬†33:¬†polishpolish¬†doesn’t contain¬†44¬†or more consecutive consonants, so it’s easy to pronounce.

Test case 44: \textcolor{red}{tryst}\textcolor{red}{tryst} contains 55 consecutive consonants, making it hard to pronounce.

Test case¬†55:¬†crycry¬†doesn’t contain any vowels, but its length is less than¬†44¬†so it’s still easy to pronounce.

Yhaa You have done it but next? if YOU Want to Get Others Please Visit Here ScishowEngineer   Then Follow US HERE and Join Telegram.

If You Want To Learn Something New Then Visit Our Official Channel YOUTUBE

Related Posts

Leave a Reply

Your email address will not be published.