#K91882. Palindromic String Verification
Palindromic String Verification
Palindromic String Verification
You are given a string. Your task is to determine whether the given string is a palindrome. A palindrome is a string that reads the same backward as forward when ignoring spaces, punctuation, and case. For example, the string "A man, a plan, a canal, Panama" is a palindrome.
To solve this problem, first remove all non-alphanumeric characters and convert the string to lowercase. Then check if the resulting string is equal to its reverse. In mathematical terms, if \( f(s) \) denotes the filtering operation, then you need to check whether:
[ f(s) = \text{reverse}(f(s)) ]
The task is simple yet a good exercise in string manipulation and the use of standard library functions.
inputFormat
The input consists of a single line containing the string \(s\) that needs to be checked.
outputFormat
Output a single line containing True
if the input string is a palindrome, otherwise output False
.
A man, a plan, a canal, Panama
True