Given a string (may contain both vowel and consonant letters), remove all consonants, then check if the resulting string is palindrome or not.
Input : abcuhuvmnba Output : YES Explanation : The consonants in the string "abcuhuvmnba" are removed. Now the string becomes "auua". Input : xayzuezyax Output : NO Input : bkldhgcj Output : -1
Remove all the consonants in the string. Check if the vowel string is a palindrome. If it is a palindrome print YES, else print NO. If string contains no vowels, then print -1.
Below is the Python implementation:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Check if the given string is vowel prime
- Python Regex - Program to accept string starting with vowel
- Minimize cost to replace all the vowels of a given String by a single vowel
- Python Program that Extract words starting with Vowel From A list
- Python | Vowel indices in String
- Program to accept Strings starting with a Vowel
- Program to find if a character is vowel or Consonant
- Alternate vowel and consonant string
- Print all Subsequences of String which Start with Vowel and End with Consonant.
- Lexicographically first alternate vowel and consonant string
- Replace every vowels with lexicographically next vowel in a String
- Count the nodes of the tree whose weighted string contains a vowel
- Python - Replace vowels by next vowel
- C Program to Check if a Given String is Palindrome
- TCP Client-Server Program to Check if a Given String is Palindrome
- Substrings starting with vowel and ending with consonants and vice versa
- Arrangement of words without changing the relative position of vowel and consonants
- Puzzle | Number of Sheets to be turned so that Prime Number has a Vowel on the other side
- Count of adjacent Vowel Consonant Pairs
- Count of N size strings consisting of at least one vowel and one consonant
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.