EDIBLE STRINGS

Given a string of lowercase alphabets A of size N.

A string is edible if it has vowels(‘a’, ‘e’, ‘i’, ‘o’, ‘u’) at only prime indexes.

Return a string B, Where B = “YES” if A is edible else B = “NO”.



Input Format

The first and only argument given is the string A.

Output Format

Return a string B,Where B = "YES" if A is edible else B = "NO".

Constraints

1 <= N <= 10^5

For Example

Input 1:
    A = "saurabh"
Output 1:
    YES
Explaination 1:
    A contains vowels at indexes 2, 3 and 5 and all of them are prime, hence making string A edible.

Input 2:
    A = "sorabh"
Output 2:
    NO
Explaination 2:
    A contains vowels at indexes 2 and 4 and all of them are not prime, hence string A is not edible.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving EDIBLE STRINGS on Interview Code Editor
Sign Up
to access hints and editorial solutions for EDIBLE STRINGS

Discussion


Loading...
Click here to start solving coding interview questions