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.
- Python program to check if a string is palindrome or not
- Python program to check whether the string is Symmetrical or Palindrome
- Python Regex - Program to accept string starting with vowel
- C Program to Check if a Given String is Palindrome
- Java program to check whether a string is a Palindrome
- TCP Client-Server Program to Check if a Given String is Palindrome
- Check if the given string is vowel prime
- Python program to check if number is palindrome (one-liner)
- Python | Vowel indices in String
- Check if a given string is Even-Odd Palindrome or not
- Python program to check if a given string is Keyword or not
- Python program to check if given string is pangram
- Program to check the number is Palindrome or not
- Program to check if an Array is Palindrome or not using STL in C++
- Program to check if an Array is Palindrome or not
- Check if both halves of a string are Palindrome or not
- Check given string is oddly palindrome or not
- Check if it is possible to create a palindrome string from given N
- Check whether the given string is Palindrome using Stack
- Check if a string is palindrome in C using pointers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.