Vowels are very essential characters to form any meaningful word in English dictionary. There are 5 vowels in English language - a, e, i, o u. You are given a randoms string containing only lowercase letters and you need to find if the string contains ALL the vowels.
Input:
FIrst line contains N , the size of the string.
Second line contains the letters (only lowercase).
Output:
Print "YES" (without the quotes) if all vowels are found in the string, "NO" (without the quotes) otherwise.
Constraints:
The size of the string will not be greater than 10,000
1 ≤ N ≤ 10000
C Implementation:
Input:
FIrst line contains N , the size of the string.
Second line contains the letters (only lowercase).
Output:
Print "YES" (without the quotes) if all vowels are found in the string, "NO" (without the quotes) otherwise.
Constraints:
The size of the string will not be greater than 10,000
1 ≤ N ≤ 10000
C Implementation:
#include <stdio.h> int main() { int n; char *s; int hash[26]; int i; scanf("%d",&n); s=(char*)malloc(sizeof(char)*1000000); scanf("%s",s); memset(hash,0,sizeof(hash)); i=0; while(*(s+i)) { hash[*(s+i)-'a']++; i++; } if(hash['a'-'a'] && hash['e'-'a'] && hash['i'-'a'] && hash['o'-'a'] && hash['u'-'a']) printf("YES"); else printf("NO"); return 0; }Output:
8
atuongih
NO