#K1101. Taco Palindrome Checker
Taco Palindrome Checker
Taco Palindrome Checker
In this problem, you are required to determine whether a given string is a palindrome. A palindrome is a string that reads the same forwards and backwards. However, you should consider only alphanumeric characters and ignore cases. Formally, let ( s ) be the input string. Define the filtered string ( t ) as follows: ( t = \text{concatenate}(\text{lowercase}(c)) ) for every character ( c ) in ( s ) if ( c ) is alphanumeric. The string is a palindrome if ( t = t^R ), where ( t^R ) is the reverse of ( t ).
inputFormat
The input consists of a single line containing a string ( s ). The string may include letters, digits, spaces, and symbols. Only alphanumeric characters are considered for determining whether ( s ) is a palindrome. Note that the string can be empty, in which case it is considered a palindrome.
outputFormat
Output a single line: either 'True' or 'False' (without quotes) indicating whether the given string is a palindrome, after ignoring cases and non-alphanumeric characters.## sample
A man, a plan, a canal: Panama
True