Given a string str, the task is to check whether the count of vowels in the given string is prime or not. If its prime then print YES else print NO.
Input: str = “geeksforgeeks”
Count of vowels is 5 (e, e, o, e and e) which is prime.
Input: str = “aeioua”
Approach: Initialize a variable count = 0 and traverse the string character by character, if the current character is a vowel then update count = count + 1. In the end, if count is prime then print YES else print NO.
Below is the implementation of the above approach:
- Minimum changes required such that the string satisfies the given condition
- Find the lexicographically smallest string which satisfies the given condition
- Given a string and an integer k, find the kth sub-string when all the sub-strings are sorted according to the given condition
- Check whether two strings are equivalent or not according to given condition
- String slicing in Python to check if a string can become empty by recursive deletion
- Check if a string can be converted to another string by replacing vowels and consonants
- Queries to check if string B exists as substring in string A
- Check if a string can be obtained by rotating another string d places
- Check if a string can be obtained by rotating another string 2 places
- Check if a string can become empty by recursively deleting a given sub-string
- Check if a string can be repeated to make another string
- Check whether second string can be formed from characters of first string
- Check if a string contains a palindromic sub-string of even length
- Check if a given string is sum-string
- Check if a string has m consecutive 1's or 0's
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.