#K9536. Check Palindrome Strings
Check Palindrome Strings
Check Palindrome Strings
Problem Description:
You are given a string s, and your task is to determine whether it is a palindrome. A palindrome is a sequence that reads the same backward as forward after removing all non-alphanumeric characters and ignoring letter case. In other words, the string should be processed to remove punctuation and spaces, and then compared to its reverse.
For example, the string A man, a plan, a canal: Panama
is a palindrome, whereas race a car
is not.
The solution should read input from standard input (stdin) and output the result to standard output (stdout) as either True
or False
.
inputFormat
Input Description:
The input consists of a single line containing a string. This string may include spaces, punctuation, and other non-alphanumeric characters. It can also be empty.
outputFormat
Output Description:
Output a single line with either True
if the given string is a palindrome (considering only alphanumeric characters and ignoring cases) or False
otherwise.## sample
A man, a plan, a canal: Panama
True