#K37772. Processed Palindrome Check
Processed Palindrome Check
Processed Palindrome Check
You are given a string s consisting of only lowercase letters. Your task is to remove any consecutive repeating characters from s to form a new string t, and then check whether t is a palindrome.
A string is a palindrome if it reads the same forwards and backwards. In other words, if we denote the reverse of t as \(t^R\), then t is a palindrome if and only if \(t = t^R\).
Note: When removing consecutive duplicates, only one occurrence of each consecutive group is retained. For example, processing aaabbaaa
results in aba
, which is a palindrome.
inputFormat
The input is provided via stdin and consists of a single line containing a non-empty string s composed of only lowercase English letters.
outputFormat
Print to stdout True
if the processed string is a palindrome, and False
otherwise.
aaabbaaa
True