S is string containing only lowercase English alphabets. We need to find if there exists at least one palindromic sub-string whose length is even.
Input : aassss Output : YES Input : gfg Output : NO
Notice that a palindrome of even length must contain two same alphabets in the middle. So we just need to check for this condition. If we find two consecutive same alphabets in the string then we output “YES” otherwise “NO”.
Below is the implementation:
- Minimum length of substring whose rotation generates a palindromic substring
- Longest Palindromic Substring using Palindromic Tree | Set 3
- Length of smallest substring of a given string which contains another string as subsequence
- Check if a string can be split into even length palindromic substrings
- Length of longest Palindromic Subsequence of even length with no two adjacent characters same
- Minimum cuts required to convert a palindromic string to a different palindromic string
- Maximum length palindromic substring such that it starts and ends with given char
- Make palindromic string non-palindromic by rearranging its letters
- Minimum K such that every substring of length atleast K contains a character c
- Length of the smallest substring which contains all vowels
- Length of the largest substring which have character with frequency greater than or equal to half of the substring
- Check if a substring can be Palindromic by replacing K characters for Q queries
- Find Nth even length palindromic number formed using digits X and Y
- Smallest Palindromic Subsequence of Even Length in Range [L, R]
- Construct a string of length L such that each substring of length X has exactly Y distinct letters
- Minimum size substring to be removed to make a given string palindromic
- Longest palindromic string possible after removal of a substring
- Rearrange string to obtain Longest Palindromic Substring
- Minimum flips required in a binary string such that all K-size substring contains 1
- Longest Even Length Substring such that Sum of First and Second Half is same
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.